This repository has been archived by the owner on Oct 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmyty.conf
113 lines (89 loc) · 3.94 KB
/
myty.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
perl_modules perl/lib;
perl_set $uri_lowercase 'sub {
my $r = shift;
my $uri = $r->uri;
$uri = lc( $uri );
return $uri;
}';
server {
server_name myty.localhost;
root /var/www/web;
index index.html index.htm index.php;
error_log stderr;
access_log stdout;
location ~ /\. {
deny all;
}
client_max_body_size 16m;
set $subdomain "_";
if ($host ~* ^([^.]+)\.) {
set $subdomain $1;
}
set $use_page_subdomain "false";
if (-e $document_root/media/pages/$subdomain/subdomain.inf) {
set $use_page_subdomain "true";
set $page $subdomain;
}
set $main "_";
if ($uri_lowercase ~* ^/((de|en)/)?([^/\?#]+)) {
set $main $3;
}
set $valid_project "false";
if (-d $document_root/media/projects/$main) {
set $valid_project "true";
}
if ($valid_project = "true") {
rewrite ^/((de|en)/)?([^/\?#]+)/?([^/\?#]*)[/\?#]?([^\?#]*?)([\?#].*)?$ /tycon/modules/crowdfunding/mvc/controller/project.controller.php?project_link_caption=$3&action=$4&newLanguage=$2&subpages=$5&_params=$6 break;
}
rewrite ^/((de|en)/)?pages/([^/\?#]+)/?([^/\?#]*)[/\?#]?([^\?#]*?)([\?#].*)?$ /tycon/modules/crowdfunding/mvc/controller/page.controller.php?page=$3&action=$4&newLanguage=$2&subpages=$5&_params=$6 break;
rewrite ^/((de|en)/)?(people|user|profile)/([^/\?#]+)/?([^/\?#]*)[/\?#]?([^\?#]*?)([\?#].*)?$ /tycon/modules/crowdfunding/mvc/controller/user.controller.php?user=$4&action=$5&newLanguage=$2&subpages=$6&_params=$7 break;
rewrite ^/((de|en)/)?messages(/|$)([^/\?#]*)[/\?#]?([^\?#]*?)([\?#].*)?$ /tycon/modules/crowdfunding/mvc/controller/message.controller.php?action=$4&newLanguage=$2&subpages=$5&_params=$6 break;
rewrite ^/((de|en)/)?conversations(/|$)([^/\?#]*)[/\?#]?([^\?#]*?)([\?#].*)?$ /tycon/modules/crowdfunding/mvc/controller/conversation.controller.php?action=$4&newLanguage=$2&subpages=$5&_params=$6 break;
set $file_exists "false";
if (-f $request_filename) {
set $file_exists "true";
}
if (!-e $request_filename) {
rewrite ^/tycon/modules/crowdfunding/api/v([\d\.]+)/.*$ /tycon/modules/crowdfunding/api/v1x/router.php?$query_string&__v=$1? last;
}
set $rewrite_page "${use_page_subdomain}_${file_exists}";
if ($rewrite_page = "true_false") {
rewrite ^/((de|en)/)?([^/\?#]*)[/\?#]?([^\?#]*?)([\?#].*)?$ /tycon/modules/crowdfunding/mvc/controller/page.controller.php?page=$page&action=$3&newLanguage=$2&subpages=$4&_params=$5 last;
}
location ~* (?:\/var|\.log$|\.ini$|\.sql$) {
return 404;
}
location ~* \.(?:css|js)$ {
expires 4h;
}
location ~* \.(?:png|jpe?g|gif|ico|pdf|flv|swf)$ {
expires 24h;
}
set $file_exists "true";
rewrite "^(\/media\/thumbnails\/[0-9a-f]{3}\/[0-9a-f]{32}\/\w+)\/.+(\.\w+)$" $1$2;
if (!-e $request_filename) {
rewrite "^/media/thumbnails/[0-9a-f]{3}/([0-9a-f]{32})/(\w+)\.(\w+)$" /tycon/modules/image/rewrite.php?hash=$1&style=$2&format=$3 last;
rewrite "^/media/tyf(d|o)(\d+)-(\w+)/(.+)\.(.+)$" /tycon/file.php?method=$1&id=$2&hash=$3&name=$4&suffix=$5 last;
rewrite ^/robots.txt /tycon/routing/robots.txt.php last;
rewrite ^/sitemap.xml /sitemap.xml.php last;
rewrite "^/tycon/modules/crowdfunding/api/v([\d\.]+)/.*$" /tycon/modules/crowdfunding/api/v1x/router.php?$query_string&__v=$1? last;
set $file_exists "false";
}
if ($request_uri ~* ^/(?:tycon|templates|media|3rdParty|fpdf)) {
set $file_exists "true";
}
if ($file_exists = "false") {
rewrite . /tycon/rewrite.php last;
}
location ~ \.php$ {
try_files /21c630385c7928a4d8ad808f753c7a6e.htm @php;
}
location @php {
try_files $uri =404;
include fastcgi_params;
fastcgi_pass php-upstream;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
}
}