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/ {
}

}
Subject Author Posted

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

Jonah October 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

Jonah October 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: 309
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