Welcome! Log In Create A New Profile

Advanced

Re: Need to remove folder name from URL

Francis Daly
February 12, 2015 05:04PM
On Thu, Feb 12, 2015 at 03:06:26AM -0500, strtwtsn wrote:

Hi there,

> We need the pages below folder_name to be accessible at
> example1.com/folder_name/page1 example1.com/folder_name/page2 etc

location /folder_name/ { proxy_pass http://example.com; }

So when the user makes a request of nginx for /folder_name/page1,
nginx does proxy_pass to example.com/folder_name/page1 and returns the
content, yes?

> This is working apart from i've been asked to make the pages below
> folder_name accessible without the folder_name
>
> So it would be example1.com/page1 example1.com/page2. They will still be
> below the folder_name, but the folder name must not show in the address
> bar.

So when the user makes a request of nginx for /page1, nginx should do
proxy_pass to example.com/folder_name/page1 and return the content, yes?

If "no", what should nginx do when the user requests /page1?

> Hope this helps.

I think I still understand the same thing. And I do not understand where
the problem is.

location / { proxy_pass http://example.com/folder_name/; }

and then presumably extra locations for the requests that should not be
handled by this proxy_pass mechanism.

What happened when you tried it?

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Need to remove folder name from URL

strtwtsn February 11, 2015 09:22AM

Re: Need to remove folder name from URL

itpp2012 February 11, 2015 09:37AM

Re: Need to remove folder name from URL

strtwtsn February 11, 2015 10:03AM

Re: Need to remove folder name from URL

itpp2012 February 11, 2015 10:06AM

Re: Need to remove folder name from URL

strtwtsn February 11, 2015 11:35AM

Re: Need to remove folder name from URL

Francis Daly February 11, 2015 03:10PM

Re: Need to remove folder name from URL

strtwtsn February 12, 2015 03:06AM

Re: Need to remove folder name from URL

Francis Daly February 12, 2015 05:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 88
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready