|
@@ -8,54 +8,40 @@ server {
|
|
|
|
|
|
charset $charset;
|
|
|
|
|
|
- set $rootdir /www/jy/public;
|
|
|
+ set $rootdir /www/huala_v2/public;
|
|
|
root $rootdir;
|
|
|
index index.php index.html;
|
|
|
-
|
|
|
- set $rewrite yes;
|
|
|
-
|
|
|
- location ~ ^/favicon\.ico$ {
|
|
|
- root $rootdir;
|
|
|
- }
|
|
|
-
|
|
|
- location ~* (.*).tpl {
|
|
|
- return 404;
|
|
|
- }
|
|
|
-
|
|
|
- if ( $request_uri ~* ^/(doc\/|public\/|upload\/|assets\/|static\/|crossdomain\.xml|index\.php|favicon\.ico) ) {
|
|
|
- set $rewrite no;
|
|
|
+ if (!-d $request_filename){
|
|
|
+ set $rule_0 1$rule_0;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- if ($rewrite ~* yes) {
|
|
|
- rewrite ^/(.*) /index.php/$1 last;
|
|
|
+ if (!-f $request_filename){
|
|
|
+ set $rule_0 2$rule_0;
|
|
|
}
|
|
|
-
|
|
|
- location ~ /(doc\/|upload\/|public\/|assets\/|static\/|crossdomain\.xml)
|
|
|
- {
|
|
|
- try_files $uri $uri/ /index.html;
|
|
|
+ if ($rule_0 = "21"){
|
|
|
+ rewrite ^/(.*)$ /index.php?s=$1 last;
|
|
|
}
|
|
|
-
|
|
|
- location /doc/ {
|
|
|
- try_files $uri $uri/ /index.html;
|
|
|
+ location / {
|
|
|
+ # First attempt to serve request as file, then
|
|
|
+ # as directory, then fall back to displaying a 404.
|
|
|
+ try_files $uri $uri/ =404;
|
|
|
+ # Uncomment to enable naxsi on this location
|
|
|
+ # include /etc/nginx/naxsi.rules
|
|
|
}
|
|
|
|
|
|
- location ~ ^(.*)$ {
|
|
|
- #add_header Access-Control-Allow-Origin http://192.168.0.109:8080;
|
|
|
- #add_header Access-Control-Allow-Headers X-Requested-With;
|
|
|
- # add_header Access-Control-Allow-Methods GET,POST,OPTIONS;
|
|
|
- #add_header Access-Control-Allow-Credentials true;
|
|
|
+ #location ~ ^(.*)$ {
|
|
|
+ location ~ \.php$ {
|
|
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
|
|
- # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
|
|
|
+ # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini (No settings!)
|
|
|
|
|
|
# With php-cgi alone:
|
|
|
+ #fastcgi_pass web-php7_swoole:9000;
|
|
|
fastcgi_pass web-php7:9000;
|
|
|
- #fastcgi_pass onepage-php5:9000;
|
|
|
+ #fastcgi_pass web-php5:9000;
|
|
|
# With php-fpm:
|
|
|
#fastcgi_pass unix:/var/run/php7-fpm.sock;
|
|
|
fastcgi_index index.php;
|
|
|
- fastcgi_param SCRIPT_FILENAME $rootdir/index.php;
|
|
|
- fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
|
+ fastcgi_param SCRIPT_FILENAME $rootdir/$fastcgi_script_name;
|
|
|
+ #fastcgi_param PATH_INFO $fastcgi_path_info;
|
|
|
include fastcgi_params;
|
|
|
}
|
|
|
}
|