-
Notifications
You must be signed in to change notification settings - Fork 7
/
quanta-nginx.conf
executable file
·58 lines (54 loc) · 1.71 KB
/
quanta-nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
server {
# CHANGE THOSE VARIABLES to fit your Nginx configuration!
listen 8080;
server_name your_site.com;
root /var/nwww/your_root;
index src/boot.php;
autoindex off;
# Used by LetsEncrypt.
location /.well-known {
rewrite ^/(.well-known)/acme-challenge/(.*) /acme-challenge/$2 break;
}
# CSS shortcut.
location /css {
rewrite ^/(css)/([0-9a-zA-Z-]+).css /sites/$host/files/css/$2.css;
}
# JS shortcut.
location /js {
rewrite ^/(js)/([0-9a-zA-Z-]+).js /sites/$host/files/js/$2.js;
}
# Files shortcut.
location /files {
rewrite ^/(files)/(.*) /sites/$host/files/$2;
}
# Assets shortcut.
location /assets {
rewrite ^/(assets)/(.*) /sites/$host/assets/$2;
}
# Thumbnails shortcut.
location /thumbs {
rewrite ^/(thumbs)/(.*) /static/tmp/$host/thumbs/$2;
}
# Temporary Dir.
location /tmp {
rewrite ^/(tmp)/(.*) /static/tmp/$host/files/$2;
}
# Modules Dir.
location /modules {
rewrite ^/(modules)/(.*) /src/modules/$2;
}
location / {
if ($request_uri ~ "/+[^\.]+$"){
rewrite ^/(.+[^/])$ /$request_uri/ redirect;
}
if (!-e $request_filename){
rewrite ^/([0-9a-zA-Z-]+) /src/boot.php;
}
}
location ~ \.php$ {
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php5-fpm.sock;
}
}