This commit is contained in:
midoks
2022-12-06 23:38:09 +08:00
parent c4bb20ed54
commit 5358cd2d38
4 changed files with 63 additions and 16 deletions
+36 -3
View File
@@ -1,15 +1,48 @@
server
{
listen {$PORT};
listen [::]:{$PORT};
#listen 443 ssl http2;
#listen [::]:443 ssl http2;
server_name {$SERVER_NAME};
index index.php index.html index.htm default.php default.htm default.html;
root {$ROOT_DIR};
#SSL-START
#error_page 404/404.html;
#ssl_certificate {$PANAL_ADDR}/ssl/cert.pem;
#ssl_certificate_key {$PANAL_ADDR}/ssl/privkey.pem;
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
#ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
#ssl_prefer_server_ciphers on;
#ssl_session_cache shared:SSL:10m;
#ssl_session_timeout 10m;
#SSL-END
#PROXY-START
location ^~ / {
proxy_pass http://0.0.0.0:{$PANAL_PORT}/;
proxy_set_header Host 0.0.0.0:{$PANAL_PORT};
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
proxy_ignore_headers Set-Cookie Cache-Control expires;
add_header Cache-Control no-cache;
set $static_files_app 0;
if ( $uri ~* "\.(gif|png|jpg|css|js|woff|woff2)$" )
{
set $static_files_app 1;
expires 12h;
}
if ( $static_files_app = 0 )
{
add_header Cache-Control no-cache;
}
}
#PROXY-END
#禁止访问的文件或目录
location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)