Hello.
I've nginx + Glassfish, with this config:
server {
listen 80;
server_name mydomain.com;
location / {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8180/app1/;
}
location /app1/ {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8180/app1/;
proxy_redirect off;
}
If I go to mydomain.com, I'm redirected to mydomain.com/app1. However, y want that the URL be mydoamin.com (without the context)
I've tried som things, like:
rewrite ^/app1/(.*)$ $1 break;
But I get errors (500, 404...)
What is the best way to do that?
Thanks!
I've nginx + Glassfish, with this config:
server {
listen 80;
server_name mydomain.com;
location / {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8180/app1/;
}
location /app1/ {
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8180/app1/;
proxy_redirect off;
}
If I go to mydomain.com, I'm redirected to mydomain.com/app1. However, y want that the URL be mydoamin.com (without the context)
I've tried som things, like:
rewrite ^/app1/(.*)$ $1 break;
But I get errors (500, 404...)
What is the best way to do that?
Thanks!