Welcome! Log In Create A New Profile

Advanced

Re: Make 1 root file accessible, and serve it for all requests

October 21, 2013 06:23AM
B.R.,

Thanks very much! That was incredibly helpful. I had to make a couple minor tweaks to get it working, and I wanted a 302 instead of a 301, but the following is what I ended up with, and it had the added benefit of cutting response time almost in half when I did a load test:

server {
listen 80;
server_name example.com;

root /var/www/register;

location = /index.html {
}

# Default location, request will fallback here if none other
# location block matches
location / {
rewrite ^.*$ /index.html redirect; # 'root' location '/'
}

location /css/ {
}

location /js/ {
}

}
SubjectAuthorPosted

Make 1 root file accessible, and serve it for all requests

JonahOctober 20, 2013 11:58PM

Re: Make 1 root file accessible, and serve it for all requests

B.R.October 21, 2013 01:04AM

Re: Make 1 root file accessible, and serve it for all requests

JonahOctober 21, 2013 06:23AM

Re: Make 1 root file accessible, and serve it for all requests

B.R.October 21, 2013 10:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 79
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready