How do I map the subdomain that I don't have to rewrite the URI?
server {
listen 80;
server_name cooking.com user.cooking.com admin.cooking.com;
root html/cooking/public;
location / {
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param FEED_ENV default;
include fastcgi_params;
}
location ~* \.(ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
}
}
So basically WHen a user access admin.cooking.com it should request for /index.php/admin/. I was thinking of using if but if is bad.
fastcgi_param URL_VAR ...;and severalserverblocks. – VBart Jul 30 '12 at 22:50