Skip to content

Commit

Permalink
Update nginx_panel.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Dec 7, 2022
1 parent 48ee557 commit e472d10
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions data/tpl/nginx_panel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,14 @@ server
#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_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
}
#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;
}

0 comments on commit e472d10

Please sign in to comment.