M
M
Maxim2015-12-15 08:56:43
Nginx
Maxim, 2015-12-15 08:56:43

How to display url when browsing subdomain on nginx?

There is a server with nginx.
I have a website address https://domain.com/path/ I want to display information from the URL https://domain.com/path/
when browsing the subdomain.domain.com subdomain . All these paths, subdomains on one site. There is such a config:

location / {
        proxy_pass https://domain.com/path$request_uri;
    }

But from him 502

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lynn "Coffee Man", 2015-12-15
@websecret_by

It should just work like this:

location / {
    proxy_pass https://domain.com/path/;
}

A
Alexey Romanenko, 2015-12-15
@slimus

It seems you are not using the directive correctly: nginx.org/ru/docs/http/ngx_http_proxy_module.html#...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question