G
G
G0rDi2016-09-22 16:52:30
Nginx
G0rDi, 2016-09-22 16:52:30

Is it possible to deploy two web servers on 1 domain?

Good afternoon,
At first glance, the question looks a little silly, but in reality it is not, its meaning is as follows.
There is a task to combine two sites 1 runs on Nginx, the second on Tomcat (a specific service), physically located on different servers and serviced by different organizations.
The task for SEO optimization is to combine them under one domain, so that the site on Nginx opens at the address, for example, mysite.ru, and the service on Tomcat at the address mysite.ru/sevices/ Of
course, everything can be done through the iframe, but then the whole point of this disappears like this how Yandex does not index iframe https://yandex.ru/support/webmaster/recommendation...
Thank you in advance for your answers.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Sharihin, 2016-09-22
@Pinsky

Read what reverse proxying is.
Everything is possible, nginx can do it.

N
neatsoft, 2016-09-22
@neatsoft

a piece of configuration from a real server:

server {
    ...
    location /services {
        proxy_pass http://127.0.0.1:8080;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
    ...
}

Documentation: nginx reverse proxy

G
G0rDi, 2016-09-23
@G0rDi

Understood Thank you all.
I also suffered with the session (proxy_cookie_path ~*^/.* /; helped)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question