I have a main server with the following nginx
config:
server {
server_name my.website.shop www.my.website.shop;
ignore_invalid_headers off;
client_max_body_size 80M;
client_body_temp_path /tmp;
underscores_in_headers on;
location /mag {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://my_another_ip$request_uri;
}
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:3001;
access_log /var/log/nginx/access.log;
access_log /var/log/nginx/shopper-front.log;
}
location /Images {
root /opt/app/my.website/backend/wwwroot/;
}
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
listen 80;
}
And in my_another_ip
, I use this compose file: https://github.com/docker/awesome-compose/blob/master/wordpress-mysql/compose.yaml
When I run docker-compose up -d
and try to access my.website.shop/mag
, I expect to show me the WordPress installation page like my.website.shop/mag/wp-admin/install.php
, but it redirects to my.website.shop/wp-admin/install.php
and removes the /mag
from the URL.
I’m not able to find where’s the issue and why it’s like this.
I can easily access the my_another_ip
and I can access WordPress from that URL, but that’s not what I’m going to have.
Would you please help me where the issue is?