Hi guys,
please help me to realize why nginx 1.8 returns 404 to subdomain page proxy_pass'ed to localhost:8088 when I try to enable CORS.
...
# main site conf
# commenting the following block makes subdomain page to be accessible again.
location / {
add_header 'Access-Control-Allow-Origin' https://subdomain.domain.extention;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
if ($host ~* ^domain\.extention$) {
rewrite ^/subpage/ https://domain.extention/ permanent;
break;
}
...
#subdomain proxied by localhost:8088
location / {
proxy_pass https://127.0.0.1:8088/subpage/;
proxy_redirect https://127.0.0.1:8088/subpage/ /;
proxy_set_header Accept-Encoding "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_ssl_session_reuse off;
}
Thanks in advance,
JB
please help me to realize why nginx 1.8 returns 404 to subdomain page proxy_pass'ed to localhost:8088 when I try to enable CORS.
...
# main site conf
# commenting the following block makes subdomain page to be accessible again.
location / {
add_header 'Access-Control-Allow-Origin' https://subdomain.domain.extention;
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
}
if ($host ~* ^domain\.extention$) {
rewrite ^/subpage/ https://domain.extention/ permanent;
break;
}
...
#subdomain proxied by localhost:8088
location / {
proxy_pass https://127.0.0.1:8088/subpage/;
proxy_redirect https://127.0.0.1:8088/subpage/ /;
proxy_set_header Accept-Encoding "";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_ssl_session_reuse off;
}
Thanks in advance,
JB