-
Notifications
You must be signed in to change notification settings - Fork 11
/
sns.conf
45 lines (40 loc) · 1.48 KB
/
sns.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
server {
listen 80;
server_name sns.localhost;
root /usr/share/nginx/html/sns;
gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
# gzip_comp_level 9;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
# gzip_http_version 1.1;
gzip_types text/plain application/xml text/css text/js text/xml application/x-javascript text/javascript application/json application/xml+rss;
rewrite ^/api/ /server/php/Slim/public/index.php;
#rewrite ^/api_explorer/api-docs/$ /client/api_explorer/api-docs/index.php last;
rewrite ^/redirect/course/([0-9]*)/affiliate/([0-9]*)/hash/([a-zA-Z0-9_\.]*)$ /server/php/course_redirect.php?course=$1&affiliate=$2&hash=$3 last;
location / {
root /usr/share/nginx/html/sns/client;
index index.html index.php;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.(jpg|jpeg|gif|png|bmp|ico) {
root /usr/share/nginx/html/sns/client/app;
if (-f $request_filename) {
break;
}
rewrite ^/images/([a-zA-Z_]*)/([a-zA-Z_]*)/(.*)$ /server/php/image.php?size=$1&model=$2&filename=$3 last;
auth_basic off;
add_header Cache-Control public;
add_header Cache-Control must-revalidate;
expires 7d;
}
rewrite ^/video/([a-zA-Z_]*)/([0-9]*)/([a-zA-Z0-9_\.]*)/([0-9]*)$ /server/php/play_video.php?type=$1&id=$2&hash=$3×tamp=$4 last;
}