-
Notifications
You must be signed in to change notification settings - Fork 12
/
nginx-conf-file.conf
63 lines (53 loc) · 2.83 KB
/
nginx-conf-file.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
59
60
61
62
63
server {
listen 80;
server_name {your_domain_url};
access_log {give_your_access_log_path_here} main;
error_log {give_your_error_log_path_here}
root {replace_root_path_here};
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/R/r.php?_url=$1&$args last;
rewrite ^/api_explorer/api-docs/$ /client/api_explorer/api-docs/index.php last;
if ($args ~ "_escaped_fragment_") {
rewrite ^ /server/php/plugins/SEO/seo.php?path=$1 last;
}
rewrite ^/video/([a-zA-Z_]*)/([0-9]*)/([a-zA-Z0-9_\.]*)/([0-9]*)$ /server/php/plugins/VideoLessons/play_video.php?type=$1&id=$2&hash=$3×tamp=$4 last;
rewrite ^/client/download/([0-9]*)/([a-zA-Z0-9_\.]*)/([0-9]*)$ /server/php/plugins/DownloadableFileLessons/download.php?id=$1&hash=$2×tamp=$3 last;
rewrite ^/ipn/receiver_account_ipn/([0-9]*)/users/([0-9]*)/hash/([a-zA-Z0-9_\.]*)$ /server/php/plugins/Payout/receiver_account_ipn.php?gateway_id=$1&user_id=$2&hash=$3 last;
rewrite ^/ipn/process_ipn/([0-9]*)/hash/([a-zA-Z0-9_\.]*)$ /server/php/plugins/SudoPay/process_ipn.php?course_user_id=$1&hash=$2 last;
rewrite ^/ipn/paypal_process_ipn/([0-9]*)/hash/([a-zA-Z0-9_\.]*)$ /server/php/plugins/PayPal/paypal_payment_process_ipn.php?course_user_id=$1&hash=$2 last;
rewrite ^/ipn/process_ipn/user_subscription_logs/([0-9]*)/hash/([a-zA-Z0-9_\.]*)$ /server/php/plugins/SudoPay/process_ipn.php?user_subscription_logs_id=$1&hash=$2 last;
rewrite ^/ipn/paypal_process_ipn/user_subscriptions/([0-9]*)/hash/([a-zA-Z0-9_\.]*)$ /server/php/plugins/PayPal/paypal_subscription_process_ipn.php?user_subscription_id=$1&hash=$2 last;
location / {
if ($http_user_agent ~* "googlebot|yahoo|bingbot|baiduspider|yandex|yeti|yodaobot|gigabot|ia_archiver|facebookexternalhit|twitterbot|developers\.google\.com") {
rewrite ^ /server/php/plugins/SEO/seo.php?path=$1;
}
root /home/nginxdev/html/{your_domain_name}/client;
index index.html index.php;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* \.(jpg|jpeg|gif|png|bmp|ico|css|js) {
root /home/nginxdev/html/{your_domain_name}/client;
if (-f $request_filename) {
break;
}
rewrite ^/img/([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;
}
}