首页 > 其他 > 详细

nginx配置文件

时间:2019-07-04 13:54:48      阅读:88      评论:0      收藏:0      [点我收藏+]

 

 

#########http###########
server{ listen
80; #监听的端口号 server_name pazzn.com www.pazzn.com; #您的域名 return 301 https://www.pazzn.com$request_uri; ####强制将80端口的流量跳转到这个https指定网址 location / { root /home/www/pazzn; #站点的路径 index index.php index.html index.htm; if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } } location ~ ^.+\.php { root /home/www/pazzn; #站点的路径 fastcgi_pass 127.0.0.1:9000; #根据自己的 php-fpm 配置填写 fastcgi_index index.php; ###配置支持pathinfo fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } ###########https#### server{ listen 443; #监听的端口号 server_name www.pazzn.com; #您的域名 ssl on; ssl_certificate /etc/letsencrypt/live/www.pazzn.com/fullchain.pem; ###其他沃通申请的证书在nginx也是改这个路径 ssl_certificate_key /etc/letsencrypt/live/www.pazzn.com/privkey.pem; ###其他沃通申请的证书在nginx也是改这个路径 location / { root /home/www/pazzn; #站点的路径 index index.php index.html index.htm; if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } } location ~ ^.+\.php { root /home/www/pazzn; #站点的路径 fastcgi_pass 127.0.0.1:9000; #根据自己的 php-fpm 配置填写 fastcgi_index index.php; ###配置支持pathinfo fastcgi_split_path_info ^((?U).+\.php)(/?.+)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }

 

证书连接:https://www.qikqiak.com/post/make-https-blog/

 

nginx配置文件

原文:https://www.cnblogs.com/Crazy-Liu/p/11131508.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!