This commit is contained in:
qiaofeng1227 2023-10-12 13:47:38 +08:00
parent 2b596addb5
commit 73d772889a
2 changed files with 6 additions and 8 deletions

View File

@ -5,9 +5,7 @@ LABEL version="2.10.4"
RUN apt-get update && apt-get install -y curl jq
COPY ./config/initproxy.conf /data/nginx/proxy_host/
# COPY ./s6/init_user /etc/s6-overlay/s6-rc.d/init_user
# RUN touch /etc/s6-overlay/s6-rc.d/user/contents.d/init_user
# RUN chmod -R 755 /etc/s6-overlay/s6-rc.d/init_user
COPY ./s6/init_user/init_user.sh /app/init_user.sh
RUN chmod +x /app/init_user.sh
CMD ["/bin/sh", "-c", "/app/init_user.sh && tail -f /dev/null"]

View File

@ -32,15 +32,14 @@ server {
proxy_pass http://websoft9-deployment:9000/;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
add_header 'Access-Control-Allow-Origin' '*';
# proxy_http_version 1.1;
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
if ($request_method = OPTIONS) {
return 204;
}
set $quot_tmp "\"";
# set $portainer_jwt "${quot_tmp}${arg_portainer_jwt}${quot_tmp}";
set $portainer_jwt "${quot_tmp}${cookie_portainerJWT}${quot_tmp}";
sub_filter '</head>' "<script>($portainer_jwt)?window.localStorage.setItem('portainer.JWT', '$portainer_jwt'):null;</script></head>";
sub_filter_once on;
@ -94,9 +93,10 @@ server {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_hide_header X-Frame-Options;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
add_header 'Access-Control-Allow-Credentials' 'true';
if ($request_method = OPTIONS) {
return 204;
}
@ -118,4 +118,4 @@ server {
# Custom
include /data/nginx/custom/server_proxy[.]conf;
}
}