I want to server up landing.html if they come without any url parameters and send them to app.html if they do. I would think this would work but it tells me I can't try files within that block.
server {
root /home/username/client/projects/web-apps/public;
index landing.html index.html index.htm;
# Make site accessible from http://test1.com/
server_name test1.com;
location ~ ^/(\d\d\d\d\d) {
try_files $uri $uri/ /app.html;
}
location /q {
try_files $uri $uri/ /app.html;
}
location / {
set $page 'landing';
if ($args) {
set $page 'app';
}
try_files $uri $uri/ $page.html;
}
location /ad {
try_files $uri $uri/ /app.html;
}
location /Location {
try_files $uri $uri/ /landing.html;
}
}
You can't use try_files within an if. This may work: