Nginx Virtual Host Configuration

Source: Internet
Author: User

server {server_name xxx.com; #这个是需要访问的域名Root/srv/www/; #web访问根目录也就是index. PHP Directory Location /{try_files$uri/app_dev.php$is _args$args; } Location~ ^/(app_dev|config) \.php (/|$) {#location中 ~ starts to represent the regular expression Fastcgi_pass127.0.0.1:9000; #指定FastCGI server address fastcgi_split_path_info^ (. +\.php) (/.*)$; #通过正则表达式获取脚本名 $fastcgi _script_name and Parameters includeFastcgi_params; #包含fastcgi_params, the file is fastcgi_param in the same directory as nginx.conf script_filename$realpath _root$fastcgi_script_name; Fastcgi_param Document_root$realpath _root; }    Error_log/srv/xxx/logs/nginx_error.Log; #存放错误日志Access_log/srv/xxx/logs/nginx_access.Log; #存放访问日志}

Nginx Virtual Host Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.