1server { 2 listen 80; 3 server_name fpb.com; 4 return 301 http://www.fpb.com$request_uri; 5} 6 7 8server 9 { 10 listen 80; 11 #listen [::]:80; 12 server_name www.fpb.com; 13 index index.html index.htm index.php default.html default.htm default.php; 14 root /home/wwwroot/www.fpb.com; 15 16 include dedecms.conf; 17 #error_page 404 /404.html; 18 19 # Deny access to PHP files in specific directory 20 #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } 21 22 include enable-php.conf; 23 24 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ 25 { 26 expires 30d; 27 } 28 29 location ~ .*\.(js|css)?$ 30 { 31 expires 12h; 32 } 33 34 location ~ /.well-known { 35 allow all; 36 } 37 38 location ~ /\. 39 { 40 deny all; 41 } 42 43 access_log off; 44 } 45 46server { 47 listen 80; 48 server_name m.fpb.com; 49 50 location / { 51 root ../a; 52 proxy_pass http://www.fpb.com/m/; 53 } 54 #error_page 500 502 503 504 /50x.html; 55 } 56 57 58server { 59 listen 80; 60 server_name zg.fpb.com; 61 62 location /templets/{ 63 proxy_pass http://www.fpb.com/templets/; 64 } 65 66 location /a/{ 67 proxy_pass http://www.fpb.com/a/; 68 } 69 70 location /uploads/{ 71 proxy_pass http://www.fpb.com/uploads/; 72 } 73 location / { 74 proxy_pass http://www.fpb.com/a/; 75 } 76 #error_page 500 502 503 504 /50x.html; 77 }
ng配置301及反向代理示例
Wesley13
2021-10-11
1236 0 0
点赞
收藏
评论区
加载中...