zoukankan      html  css  js  c++  java
  • nginx配置文件

    #########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/

  • 相关阅读:
    Linux中yum命令镜像源和出错解决方案
    Redis编译安装
    Linux下安装Redis
    zabbix3.4.2的安装及配置
    【前端】活动表单
    【笔记】archlinux缺少部分常用工具
    【笔记】BootstrapTable带参数刷新数据的坑
    【笔记】Win7连接公司内网无法打开网页
    【笔记】Archlinux下配置rsyslog写日志到mysql
    【笔记】Gave up waiting for suspend/resume device
  • 原文地址:https://www.cnblogs.com/Crazy-Liu/p/11131508.html
Copyright © 2011-2022 走看看