Welcome! Log In Create A New Profile

Advanced

Remove context from backend

Posted by josea.guardia 
Remove context from backend
May 25, 2016 05:22AM
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!
Re: Remove context from backend
May 30, 2016 04:22AM
Nobody can help me??
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 183
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready