Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Remove context from backend

$
0
0
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!

Viewing all articles
Browse latest Browse all 4759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>