I have two VMs, the first one (vm-1) is running nginx as reverse proxy with the following configuration:
server {
listen 80;
server_name example.com;
return 301 https://example.com$request_uri;
}
server {
server_name example.com;
location /app1 {
proxy_pass http://ip-vm-2:8080;
}
location /app2 {
proxy_pass http://ip-vm-2:80;
}
listen 443 ssl;
ssl_certificate ....
}
For the second vm (vm-2), I have app1 (a standalone jar) on port 8080 which is working correctly and I can access it from https://example.com/app1.
For app2, I have installed nginx and copied a website to /var/www/html, altough I can access it from http://ip-vm-2, I does not work from https://example.com/app2, which is what I want.
I don't know exactly what the problem is with the configuration in the reverse proxy.
return
statement of the firstserver
block redirect to itself? – Tommiie Jan 29 '19 at 13:43does not work
in more detail. Do you get wrong content? Do you get an error? If so, what's the error message? – Gerald Schneider Jan 29 '19 at 14:16