0

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;
    }
}
7
  • please find error log and send error $ sudo vi /etc/nginx/nginx.conf error is locatation cleared in line error_log /var/log/nginx/error.log debug; Oct 6, 2020 at 9:21
  • configure the backend server on example.com with the correct baseurl of abcd,com. Oct 6, 2020 at 9:21
  • can i make it work without touch the backend?
    – Sinauwae
    Oct 6, 2020 at 9:28
  • This is a redirect, use proxy_redirect, for example proxy_redirect http://example.com http://whatever; - see this document. Oct 6, 2020 at 10:11
  • still not working, this problem is happen in just 1 page which is example.com/login
    – Sinauwae
    Oct 6, 2020 at 10:47

0

You must log in to answer this question.

Browse other questions tagged .