nginx: [emerg] directive "location" has no opening "{" in /u
手贱按网上的方法改lnmp默认站点和主机头值就报错了,然后又复制网上的那个就报这个错了,求大牛破。nginx: directive "location" has no opening "{" in /usr/local/nginx/conf/nginx.conf:72
failed. Use force-quit
还有如何设置强制允许https。我在www.xxx.com.conf里删掉了80那一行,http的指向了默认lnmp页面,求破。。还有怎么设置用户不能通过ip访问服务器。或者说就是ip访问就像该服务器没有搭建web服务的样子。
nginx.conf的代码如下:
userwww www;
worker_processes auto;
error_log/home/wwwlogs/nginx_error.logcrit;
pid /usr/local/nginx/logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
multi_accept on;
}
http
{
include mime.types;
default_typeapplication/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
sendfile on;
tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE \.";
#limit_conn_zone $binary_remote_addr zone=perip:10m;
##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
server_tokens off;
#log format
log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
server {
listen 80;
server_name www.lnmp.org;
access_log /home/wwwlogs/access_nginx.log combined;
root /home/wwwroot/default;
index index.html index.php;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location ~ .*\. (php|php5)? [ DISCUZ_CODE_14 ]nbsp; {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|ico)$ {
expires 30d;
}
location ~ .*\.(js|css)?$ {
expires 7d;
}
}
access_log/home/wwwlogs/access.logaccess;
}
include vhost/*.conf;
} location ~ .*\. (php|php5)? [ DISCUZ_CODE_14 ]nbsp; { 这一行很明显的错误
fastcgi_pass unix:/dev/shm/php-cgi.sock; 这一行也不对
你可以看一下lnmp安装包里的nginx.conf
回复 2# 的帖子
亲。我已经重装了。请问我该如何关闭默认的安装成功站点就是说关闭不能通过ip访问站点。还有就是如何强制https访问。网上的方法试了不是这出问题就是那出问题,我是用的centos6.6 64位 论坛里搜索空主机头参考:http://lnmp.org/faq/lnmp-nginx-301-rewrite.html
页:
[1]