Answer the question
In order to leave comments, you need to log in
Is it possible in NGINX to proxy a mirror to a specific url (subdomain.domain.com -> domain.com/subdomain)?
Is it possible to proxy a mirror to a specific url in NGINX: subdomain.domain.com => domain.com/subdomain
I.e. without changing the address bar in the browser
Thank you
Answer the question
In order to leave comments, you need to log in
nginx.org/ru/docs/http/ngx_http_proxy_module.html#...
server {
listen 80;
server_name subdomain.domain.com;
location / {
proxy_pass http://domain.com/subdomain/;
}
}
I found a solution for myself:
server {
listen 80;
server_name subdomain.domain.com;
location / {
rewrite ^/$ /subdomain/$1 break;
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_redirect off;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question