Advertisement
hong1999

Nginx Subfolder

Aug 5th, 2021
1,075
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.33 KB | None | 0 0
  1. server {
  2.   listen 80;
  3.   listen [::]:80;
  4.   listen 443 ssl http2;
  5.   listen [::]:443 ssl http2;
  6.   ssl_certificate /usr/local/nginx/conf/ssl/davelee.com.crt;
  7.   ssl_certificate_key /usr/local/nginx/conf/ssl/davelee.com.key;
  8.   ssl_protocols TLSv1.2 TLSv1.3;
  9.   ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  10.   ssl_prefer_server_ciphers on;
  11.   ssl_session_timeout 10m;
  12.   ssl_session_cache builtin:1000 shared:SSL:10m;
  13.   ssl_buffer_size 4000;
  14.   ssl_stapling on;
  15.   ssl_stapling_verify on;
  16.   server_name davelee.com www.davelee.com;
  17.   access_log off;
  18.   index index.html index.htm index.php;
  19.   root /data/wwwroot/davelee;
  20.   if ($host != www.davelee.com) {  return 301 $scheme://www.davelee.com$request_uri;  }
  21.   if ($ssl_protocol = "") { return 301 https://$host$request_uri; }
  22.  
  23.   error_page 301 400 403 404 500 502 503 504 =444 /444.html;
  24.     location = /444.html {
  25.         return 444;
  26.        
  27.   }
  28.  
  29.  
  30.   include /usr/local/nginx/conf/rewrite/wordpress.conf;
  31.  
  32.  
  33.   location ~ /xmlrpc.php.php {  
  34. #   fastcgi_pass remote_php_ip:9000;
  35.     fastcgi_pass unix:/dev/shm/php-cgi.sock;
  36.     fastcgi_index index.php;
  37.     include fastcgi.conf;
  38.     deny all;
  39.   }
  40.  
  41.   location ~ /wp-login.php {
  42. #   fastcgi_pass remote_php_ip:9000;
  43.     fastcgi_pass unix:/dev/shm/php-cgi.sock;
  44.     fastcgi_index index.php;
  45.     include fastcgi.conf;
  46.     allow 10.1.1.0/24;
  47.     allow all;
  48.   }
  49.  
  50.   location ~ /robots.txt {
  51.     allow all;
  52.     log_not_found off;
  53.     access_log off;
  54.   }
  55.  
  56.   location ~ /ads.txt {
  57.     allow all;
  58.     log_not_found off;
  59.     access_log off;
  60.   }
  61.  
  62.   location ~ [^/]\.php(/|$) {
  63.     try_files $uri =404;
  64.     fastcgi_split_path_info ^(.+\.php)(/.+)$;
  65. #   fastcgi_pass remote_php_ip:9000;
  66.     fastcgi_pass unix:/dev/shm/php-cgi.sock;
  67.     fastcgi_index index.php;
  68.     include fastcgi.conf;
  69.   }
  70.  
  71.  
  72.   location /zh/ {
  73.      try_files $uri $uri/  /zh/index.php?$args;
  74.   }
  75.  
  76.  
  77.  
  78.   location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
  79.     expires 30d;
  80.     access_log off;
  81.   }
  82.  
  83.   location ~ .*\.(js|css)?$ {
  84.     expires 7d;
  85.     access_log off;
  86.   }
  87.  
  88.   location ~ /(\.user\.ini|\.ht|\.git|\.svn|\.project|LICENSE|README\.md) {
  89.     deny all;
  90.   }
  91. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement