I have a server which I want to hosts two web apps (one site and one webapp for instance) and a newbie with nginx (and webhosting).
I have:
- a web server (accessible using
http://server.name
) - a main site address (main.site.name or www.main.site.name). Its content is on the server in
/usr/share/nginx/www.main.site.name
- a web app with a specific adress (subdomain.other.site). Its content is on the server in
/usr/share/nginx/test
I configured my main site using this:
server {
server_name .main.site.name;
root /usr/share/nginx/www.main.site.name;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
I configured my wab app using this but it does not work:
server {
listen subdomain.other.site:80;
server_name subdomain.other.site;
root /usr/share/nginx/test;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
location ~ \.csv$ {
alias /usr/share/nginx/test/$uri;
}
}
This configuration always show me the index.html from the /usr/share/nginx/www.main.site.name
How can I rewrite my configuration to make this work ? Should I use rewrite directives, but how ?