mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 02:39:26 +08:00
55 lines
1.4 KiB
Plaintext
Executable File
55 lines
1.4 KiB
Plaintext
Executable File
server
|
|
{
|
|
listen {$PORT};
|
|
listen [::]:{$PORT};
|
|
|
|
server_name {$SERVER_NAME};
|
|
index index.php index.html index.htm default.php default.htm default.html;
|
|
|
|
#SSL-START
|
|
#error_page 404/404.html;
|
|
#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_http_version 1.1;
|
|
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)
|
|
{
|
|
return 404;
|
|
}
|
|
|
|
#一键申请SSL证书验证目录相关设置
|
|
location ~ \.well-known{
|
|
allow all;
|
|
}
|
|
|
|
|
|
access_log {$LOGPATH}/{$SERVER_NAME}.log main;
|
|
error_log {$LOGPATH}/{$SERVER_NAME}.error.log;
|
|
} |