女黑客安全网nginx配置文件泄露事件-女黑客-必火安全学院

女黑客

 找回密码
 立即注册

QQ登录

只需一步,快速开始

女黑客安全网nginx配置文件泄露事件

[复制链接]
发表于 2019-11-15 11:44:22 | 显示全部楼层 |阅读模式
nginx 配置,我好难啊
  1. server{
  2.         listen 443;
  3.         server_name nvhack.com;
  4.         rewrite ^(.*)$ https://www.${server_name}$1 permanent;   
  5. }
  6. server {
  7.         listen       80;
  8.         root /home/wwwroot/nvhack_com/public_html;
  9.         server_name nvhack.com www.nvhack.com;
  10.         rewrite ^(.*)$ https://www.${server_name}$1 permanent;
  11.         index  index.html index.php index.htm;
  12.         error_page  400 /errpage/400.html;
  13.         error_page  403 /errpage/403.html;
  14.         error_page  404 /errpage/404.html;
  15.         error_page  503 /errpage/503.html;
  16.         location ~ \.php(.*)$ {
  17.                 fastcgi_pass  unix:/tmp/php-70-cgi.sock;
  18.                 fastcgi_index  index.php;
  19.                 fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
  20.                 fastcgi_param PATH_INFO $2;
  21.                 include fcgi.conf;
  22.         }
  23.         location ~ /\.ht {
  24.                 deny  all;
  25.         }
  26.         location / {
  27.                  try_files $uri $uri/ /?$args;
  28.         }
  29. }

  30. server {
  31.         listen       443 default_server ssl;
  32.         server_name www.nvhack.com;
  33.         root /home/wwwroot/nvhack_com/public_html;
  34.         ssl                  on;
  35.         ssl_certificate      cert/nvhack.com.pem;
  36.         ssl_certificate_key  cert/nvhack.com.key;
  37.         ssl_prefer_server_ciphers on;
  38.         ssl_session_timeout 10m;
  39.         ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  40.         ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  41.         
  42.         index  index.html index.php index.htm;
  43.         error_page  400 /errpage/400.html;
  44.         error_page  403 /errpage/403.html;
  45.         error_page  404 /errpage/404.html;
  46.         error_page  503 /errpage/503.html;
  47.         location ~ \.php(.*)$ {
  48.                 fastcgi_pass  unix:/tmp/php-70-cgi.sock;
  49.                 fastcgi_index  index.php;
  50.                 fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
  51.                 fastcgi_param PATH_INFO $2;
  52.                 include fcgi.conf;
  53.         }
  54.         location ~ /\.ht {
  55.                 deny  all;
  56.         }
  57.         location / {
  58.                  try_files $uri $uri/ /?$args;
  59.         }
  60. }

复制代码

另外非Https用下面这个
  1. server {
  2.         listen 80;
  3.         server_name nanhack.com;
  4.         return 301 http://www.nanhack.com$request_uri;
  5. }
  6. server {
  7.         listen       80;
  8.         root /home/wwwroot/nanhack_com/public_html;
  9.         server_name www.nanhack.com;
  10.         index  index.html index.php index.htm;
  11.         error_page  400 /errpage/400.html;
  12.         error_page  403 /errpage/403.html;
  13.         error_page  404 /errpage/404.html;
  14.         error_page  503 /errpage/503.html;
  15.         location ~* ^/payload/upload/uploads/.*\.(php|php5)$
  16.     {  
  17.         #deny all;
  18.                 rewrite ^/ http://www.bihuo.cn/webshell/index.php;
  19.     }
  20.         location ~ \.php(.*)$ {
  21.                 fastcgi_pass  unix:/tmp/php-71-cgi.sock;
  22.                 fastcgi_index  index.php;
  23.                 fastcgi_param  SCRIPT_FILENAME  $DOCUMENT_ROOT$fastcgi_script_name;
  24.                 fastcgi_param PATH_INFO $2;
  25.                 include fcgi.conf;
  26.         }
  27.         location ~ /\.ht {
  28.                 deny  all;
  29.         }
  30.         location / {
  31.                  try_files $uri $uri/ /?$args;
  32.         }
  33. }

复制代码




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|小黑屋|女黑客 |网站地图

© Copyright 2021 版权所有(一极教育科技有限公司)

津ICP备17008032号-3
快速回复 返回顶部 返回列表