So the problem is happen to just one http://example.com/login , the other is work properly. everytime my site http://abcd.com/login is always redirect to http://example.com/. I try to curl -I http://abcd.com/login and this is what i got:
HTTP/1.1 302 Found
Server: nginx/1.14.0 (Ubuntu)
Date: Tue, 06 Oct 2020 08:39:05 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
Cache-Control: private, must-revalidate
Pragma: no-cache
Expires: -1
Location: http://example.com
Set-Cookie: XSRF-TOKEN=eyJpdiI6ImF4cXZxxxxxxxxxxxxxxxxxxxx
Set-Cookie: laravel_session=eyJpdxxxxxxxxxxxxxx
I try sub_filter but not working at this page, any solution?? this is my conf
server {
listen 80;
location / {
proxy_pass http://example.com;
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types text/css text/html text/javascript application/java;
sub_filter 'example.com' 'abcd.com';
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
proxy_redirect
, for exampleproxy_redirect http://example.com http://whatever;
- see this document.