Created
October 24, 2017 07:09
-
-
Save anonymous/e66e5094ddff71e8ea9e144647662358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen *:80; | |
server_name collab.example.com; | |
access_log /var/log/nginx/ac.access.log; | |
error_log /var/log/nginx/ac.error.log; | |
set $root_path /usr/share/nginx/html/collabs/public; | |
root $root_path; | |
index index.html index.htm index.php router.php; | |
charset utf-8; | |
if (!-e $request_filename) { | |
rewrite ^/assets/(.*)$ /assets/$1 last; | |
rewrite ^/avatars/(.*)$ /avatars/$1 last; | |
rewrite ^/wallpapers/(.*)$ /wallpapers/$1 last; | |
rewrite ^/verify-existence$ /verify.php last; | |
rewrite ^/proxy.php$ /proxy.php last; | |
rewrite ^/api/v([0-9]*)/(.*)$ /api.php?path_info=$2&api_version=$1 last; | |
rewrite ^$ /router.php last; | |
rewrite ^(.*) /router.php?path_info=$1 last; | |
} | |
location ~ ^/(assets|avatars|wallpapers)/ { | |
root $root_path; | |
} | |
location = /robots.txt { | |
allow all; | |
log_not_found off; | |
access_log off; | |
} | |
location ~ \.php$ { | |
try_files $uri =404; | |
fastcgi_split_path_info ^(.+\.php)(/.+)$; | |
fastcgi_pass 127.0.0.1:9000; | |
fastcgi_read_timeout 150; | |
fastcgi_index index.php; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment