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

Add virtual path for a site

$
0
0
Hello,
I'm trying to add virtual path to a site and redirect it to the same content as the root.
This is the config I have at the moment:

server {
listen 80;
listen [::]:80;

server_name url.example.com;

root /var/www/url.example.com/path1/path2;
index index.html;

location / {
try_files $uri $uri/ =404;
}
}

I like to make it when the user using the url url.example.com/foo/bar/ it will display the same website as in /

I've tried several options I saw online, but none worked.

Any idea how can I get there?

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>