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/

  • 相关阅读:
    解决一起web 页面被劫持的案例
    django rest framwork教程之外键关系和超链接
    django restframwork 教程之authentication权限
    Puppet nginx+passenger模式配置
    Django restframwork教程之类视图(class-based views)
    使用emplace操作
    C++中的显示类型转换
    整数加法
    在不知道学生人数和每个学生课程数量的情况下对学生的平均成绩排序
    树的高度
  • 原文地址:https://www.cnblogs.com/Crazy-Liu/p/11131508.html
Copyright © 2011-2022 走看看