Skip to content

Instantly share code, notes, and snippets.

@SunDi3yansyah
Created September 6, 2014 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SunDi3yansyah/966c7164eff435c59f5a to your computer and use it in GitHub Desktop.
Save SunDi3yansyah/966c7164eff435c59f5a to your computer and use it in GitHub Desktop.
Create Sub Domain for NGINX a.k.a Virtual Host by. SunDi3yansyah
server {
server_name sub.domain;
access_log /usr/share/nginx/html/sub.domain/access.log;
error_log /usr/share/nginx/html/sub.domain/error.log;
root /usr/share/nginx/html/sub.domain;
location / {
root /usr/share/nginx/html/sub.domain;
index index.php index.htm index.html;
}
location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires max;
}
location ~ .php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment