This commit is contained in:
qiaofeng1227 2023-10-26 16:37:36 +08:00
parent c746950e3f
commit 5eb9f3862c
3 changed files with 30 additions and 7 deletions

View file

@ -1,4 +1,4 @@
# modify time: 202310251750, you can modify here to trigger Docker Build action
# modify time: 202310261640, you can modify here to trigger Docker Build action
# from Dockerfile: https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/Dockerfile
# from image: https://hub.docker.com/r/jc21/nginx-proxy-manager

View file

@ -102,11 +102,30 @@ server {
}
}
location /apidocs/ {
proxy_pass http://websoft9-apphub:8080/docs;
sub_filter 'src="/static' 'src="/apidocs/static';
sub_filter 'spec-url="/' 'spec-url="/apidocs/openapi.json';
}
location /apidocs/ {
proxy_pass http://websoft9-apphub:8080/docs;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
sub_filter 'spec-url="/apidocs/openapi.json' 'spec-url="/openapi.json';
}
location /static/ {
proxy_pass http://websoft9-apphub:8080/static/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location = /openapi.json {
proxy_pass http://websoft9-apphub:8080/openapi.json;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /media/ {
proxy_pass http://websoft9-apphub:8081/images/;

View file

@ -4,7 +4,11 @@ set +e
nginx_proxy(){
if [ ! -f /data/nginx/proxy_host/initproxy.conf ] || [ $(stat -c %Y /etc/shadow) -ge $(stat -c %Y /data/nginx/proxy_host) ]
current_time=$(date +%s)
shadow_modified_time=$(stat -c %Y /etc/shadow)
time_difference=$((current_time - shadow_modified_time))
if [ ! -f /data/nginx/proxy_host/initproxy.conf ] || [ $time_difference -le 60 ]
then
cp /etc/initproxy.conf /data/nginx/proxy_host/
echo "Update initproxy.conf to Nginx"