Skip to content

Instantly share code, notes, and snippets.

@lambdacpp
Created August 29, 2015 07:33
Show Gist options
  • Select an option

  • Save lambdacpp/f3315bd605178c22c75b to your computer and use it in GitHub Desktop.

Select an option

Save lambdacpp/f3315bd605178c22c75b to your computer and use it in GitHub Desktop.
nginx服务default文件配置(替换_new_host_)
server {
listen 80;
client_max_body_size 20M;
server_name _new_host_.cdu.edu.cn;
charset UTF-8;
index default.html default.htm default.php index.html index.htm index.php;
set $root /var/www/_new_host_/wwwroot/public/www;
root $root;
autoindex off;
#if ($host != '_new_host_.cdu.edu.cn') {
# rewrite ^/(.*)$ http://_new_host_.cdu.edu.cn/$1 permanent;
#}
location ~ /\.ht {
deny all;
}
#deny download
location ~* \.(config|env|gitattributes|gitignore|yml)$ {
deny all;
}
#error_page 404 /err/404.htm;
#location /uploads/ {
# alias /var/www/_new_host_/wwwroot/public/www/uploads/;
#}
#try_files $uri @uwsgi;
#location @uwsgi{
#include uwsgi_params;
#uwsgi_pass unix:/tmp/360ito_uwsgi.sock;
#proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header Host $host;
#proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_pass http://localhost:5000;
#}
location ~ \.php$ {
root html;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $root$fastcgi_script_name;
#fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/";
include fastcgi_params;
#include fastcgi.conf;
}
#access_log /var/www/_new_host_/logs/access.log;
include /var/www/_new_host_/wwwroot/nginx_htaccess;
#server_name_in_redirect on;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment