问题描述
nginx版本是1.11,在nginx.conf文件中增加了下面这个server块,nginx就不能启动,把feature这个单词改为其他单词,就可以启动,不知什么原理?
#laravel-5-4-feature.com server {listen 80;server_name laravel-5-4-feature.com;charset utf-8;location / { root D:/wnmp/www/laravel-5-4-feature/public; index index.php index.html index.htm; try_files $uri $uri/ /index.php?$query_string;}error_page 500 502 503 504 /50x.html;location = /50x.html { root html;}location ~ .php$ { root D:/wnmp/www/laravel-5-4-feature/public; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; includefastcgi_params;} }
问题解答
回答1:应该不是 feature 的问题
我在 nginx version: nginx/1.10.3下测试无此问题。我升级下nginx看看
已升级为 nginx version: nginx/1.12.0
测试配置:
server { server_name test-feature.dev;}
运行结果:
~ ❯❯❯ curl -I http://test-feature.dev/HTTP/1.1 200 OKServer: nginx/1.12.0Date: Fri, 30 Jun 2017 12:51:21 GMTContent-Type: text/htmlContent-Length: 612Last-Modified: Tue, 18 Oct 2016 15:03:19 GMTConnection: keep-aliveVary: Accept-EncodingETag: '580639b7-264'Accept-Ranges: bytes
还请楼主提供下具体的nginx -t报错信息