Set up all that basic shit
This commit is contained in:
parent
1b96e2c199
commit
6c9c04a85d
5 changed files with 198 additions and 0 deletions
57
conf/nginx.conf
Normal file
57
conf/nginx.conf
Normal file
|
@ -0,0 +1,57 @@
|
|||
server
|
||||
{
|
||||
listen 80;
|
||||
server_name *.leaderbin.com;
|
||||
|
||||
if ($host ~* "^(.+)\.leaderbin\.com$")
|
||||
{
|
||||
rewrite ^(.*)$ http://leaderbin.com$1 permanent;
|
||||
}
|
||||
}
|
||||
|
||||
server
|
||||
{
|
||||
listen 80;
|
||||
server_name local.leaderbin.com leaderbin.com;
|
||||
|
||||
access_log /var/log/nginx/leaderbin.com.access.log;
|
||||
error_log /var/log/nginx/leaderbin.com.error.log;
|
||||
|
||||
root /var/www/leaderbin.com/public;
|
||||
|
||||
rewrite_log on;
|
||||
|
||||
# Rewrites static content with an appended timestamp
|
||||
location ~ ^/(.+)\.(\d+)\.(css|js|gif|png|jpg|jpeg)$
|
||||
{
|
||||
rewrite ^/(.+)\.(\d+)\.(css|js|gif|png|jpg|jpeg)$ /$1.$3 break;
|
||||
expires max;
|
||||
}
|
||||
|
||||
location /
|
||||
{
|
||||
index index.php;
|
||||
|
||||
# Strips the trailing slash
|
||||
rewrite ^/(.*)/$ /$1 permanent;
|
||||
|
||||
# If file exists return it right away
|
||||
if (-f $request_filename)
|
||||
{
|
||||
expires max;
|
||||
break;
|
||||
}
|
||||
|
||||
# and the rest
|
||||
rewrite ^/(.+)$ /index.php?request=$1 last;
|
||||
}
|
||||
|
||||
location ~ \.php$
|
||||
{
|
||||
try_files $uri =404;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME /var/www/leaderbin.com/public$fastcgi_script_name;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue