-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1-mvc.server.conf
51 lines (47 loc) · 1.67 KB
/
1-mvc.server.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
server {
listen 80;
server_name serverName.com www.serverName.com;
access_log /var/wwws/serverName/logs/request.log combined;
error_log /var/wwws/serverName/logs/error.log info;
root /var/wwws/serverName/htdocs;
error_page 404 /?action=error/404;
location ~* ^/(js|scripts|css|styles|img|images)/(.+) {
if_modified_since exact;
etag on;
try_files /web_root/$1/$2 =404;
}
location / {
limit_except GET POST PUT OPTIONS {
deny all;
}
client_max_body_size 20M;
error_page 558 = @uploadfile;
if ( $request_method = 'OPTIONS' ) {
add_header "Access-Control-Allow-Origin" "*";
add_header "Access-Control-Allow-Headers" "Accept,Origin,Content-Type,X-Requested-With,Content-Range,Content-Disposition";
add_header "Access-Control-Max-Age" 1728000;
add_header "Access-Control-Allow-Methods" "POST,GET,OPTIONS";
add_header "Access-Control-Allow-Credentials" "false";
return 200;
}
if ( $request_method = 'PUT' ) {
return 558;
}
include fastcgi_params;
fastcgi_pass local_php;
fastcgi_param LOGS_ROOT /var/wwws/serverName/logs;
fastcgi_param DOCUMENT_ROOT /var/wwws/serverName/htdocs;
fastcgi_param ORIGINAL_REQUEST_METHOD $request_method;
fastcgi_param SCRIPT_FILENAME /var/wwws/serverName/htdocs/index.php;
}
location @uploadfile {
client_max_body_size 20M;
include fastcgi_params;
fastcgi_pass local_php;
fastcgi_param LOGS_ROOT /var/wwws/serverName/logs;
fastcgi_param REQUEST_METHOD 'PUT';
fastcgi_param ORIGINAL_REQUEST_METHOD $request_method;
fastcgi_param DOCUMENT_ROOT /var/wwws/serverName/htdocs;
fastcgi_param SCRIPT_FILENAME /var/wwws/serverName/htdocs/index.php;
}
}