|
| 1 | +worker_processes 4; |
| 2 | + |
| 3 | +http { |
| 4 | + include mime.types; |
| 5 | + default_type application/octet-stream; |
| 6 | + |
| 7 | + server { |
| 8 | + listen 80 default_server; |
| 9 | + server_name localhost; |
| 10 | + root /var/www/html; |
| 11 | + |
| 12 | + |
| 13 | + access_log /var/log/nginx/access.all.log; |
| 14 | + error_log /var/log/nginx/error.log warn; |
| 15 | + |
| 16 | + default_type 'text/plain'; |
| 17 | + |
| 18 | + try_files /sys-temp/static-cache/$host/$uri/index.html |
| 19 | + |
| 20 | + if ( $request_uri ~ "^/(images|tinymce|install.php|install_update.php|captcha.php|styles|css|\.css|js|runscripts)") { break; } |
| 21 | + |
| 22 | + |
| 23 | + if (-e $request_filename) { |
| 24 | + rewrite ^/(sys\-temp|cache|xmldb|static|packages)\/.*$ /500/ break; |
| 25 | + } |
| 26 | + |
| 27 | + if (!-e $request_filename) { |
| 28 | + rewrite ^/robots\.txt /sbots.php?path=$1&$query_string last; |
| 29 | + rewrite ^/sitemap\?([0-9]*).xml /sitemap.php?id=$1 last; |
| 30 | + rewrite ^(.*)\.xml$ /index.php?xmlMode=force&path=$1&$query_string last; |
| 31 | + rewrite ^/(udata|upage|uobject|ufs|usel|ulang|utype|umess|uhttp):?(\/\/)?(.*)$ /releaseStreams.php?scheme=$1&path=$3&$query_string last; |
| 32 | + rewrite ^(.*)\.json$ /index.php?jsonMode=force&path=$1&%query_string last; |
| 33 | + rewrite ^/.* /index.php?path=$fastcgi_script_name&$query_string last; |
| 34 | + } |
| 35 | + |
| 36 | + location ~* ^/(images|files|logs)/.+\.(php|php3|php4|php5|phtml|phps|pl|pm)$ { |
| 37 | + deny all; |
| 38 | + } |
| 39 | + |
| 40 | + location / { |
| 41 | + rewrite ^/~/([0-9]+)$ /tinyurl.php?id=$1 break; |
| 42 | + index index.php; |
| 43 | + } |
| 44 | + |
| 45 | + location ~* (config\.ini|install\.ini|install\.log|umi\.nginx\.conf|dbview\.php|umibackup) { |
| 46 | + rewrite ^(.*)$ / permanent; |
| 47 | + } |
| 48 | + |
| 49 | + location ^~ /(config\.ini|classes|logs|libs|sys-temp|tpls|umaps|usels|xsltTpls) { |
| 50 | + deny all; |
| 51 | + } |
| 52 | + |
| 53 | + location ^~ /styles/common/other/elfinder/php/ { |
| 54 | + location ~.*\.(php)?$ |
| 55 | + { |
| 56 | + deny all; |
| 57 | + } |
| 58 | + } |
| 59 | + |
| 60 | + location ~* /files/ { } |
| 61 | + |
| 62 | + location ~* ^.+\.(php)$ { |
| 63 | + fastcgi_pass runtime:9000; |
| 64 | + fastcgi_index index.php; |
| 65 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 66 | + include fastcgi_params; |
| 67 | + fastcgi_connect_timeout 3060; |
| 68 | + fastcgi_send_timeout 3180; |
| 69 | + fastcgi_read_timeout 3180; |
| 70 | + fastcgi_buffer_size 32k; |
| 71 | + fastcgi_buffers 4 32k; |
| 72 | + fastcgi_busy_buffers_size 32k; |
| 73 | + fastcgi_temp_file_write_size 32k; |
| 74 | + fastcgi_temp_path /tmp; |
| 75 | + |
| 76 | + } |
| 77 | + } |
| 78 | +} |
| 79 | +######################## UMI_CMS_NGINX_END ############################ |
0 commit comments