due to the needs of the project, the front-end js cannot cross domains, so I use nginx to reverse proxy. Since I am testing locally, I am a windows system. Nginx listens to 8010. Apache listens to 8080. Local hosts 127.0.0.1 mychain.com
nginx is configured as follows
upstream mychain.com
{
server 127.0.0.1:8080;
}
server
{
listen 80;
server_name mychain.com;
location /
{
proxy_pass http://mychain.com;
proxy_redirect off;
proxy_set_header Host $proxy_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
}
apache is configured as follows
<VirtualHost *:8080>
ServerName mychain.com
ServerAlias *.mychain.com
DocumentRoot c:/www/chain/public
<Directory "c:/www/chain/public">
Options +Indexes +Includes +FollowSymLinks +MultiViews
AllowOverride All
Allow from all
</Directory>
</VirtualHost>
but every time I visit mychain.com
, url will automatically jump to localhost:8080
how to prevent url from jumping?