nginx虚拟主机配置
Posted 大雾哥
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx虚拟主机配置相关的知识,希望对你有一定的参考价值。
1 server { 2 listen 80; 3 server_name real.zhudai.com; 4 access_log /var/log/nginx/real.zhudai.com-access.log; 5 error_log /var/log/nginx/real.zhudai.com-error.log; 6 root /var/www/www.zhudai.com/www; 7 index index.php index.html index.htm; 8 location / { 9 try_files $uri $uri/ /index.php$is_args$args; 10 } 11 location ~ \.php$ { 12 include fastcgi_params; 13 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 14 fastcgi_pass 127.0.0.1:9000; 15 try_files $uri = 404; 16 } 17 location ~ /\.(ht|svn|git) { 18 #deny all; 19 } 20 }
以上是关于nginx虚拟主机配置的主要内容,如果未能解决你的问题,请参考以下文章
Nginx——Nginx启动报错Job for nginx.service failed because the control process exited with error code(代码片段