VPS侦探论坛

 找回密码
 注册
查看: 4956|回复: 1

lnmp 404按教程配置就出现502

[复制链接]
发表于 2013-10-20 12:08:40 | 显示全部楼层 |阅读模式

配置nginx.conf文件我是以下配置的,但是这样就会出现502
  1. user  www www;

  2. worker_processes 1;

  3. error_log  /home/wwwlogs/nginx_error.log  crit;

  4. pid        /usr/local/nginx/logs/nginx.pid;

  5. #Specifies the value for maximum file descriptors that can be opened by this process.
  6. worker_rlimit_nofile 51200;

  7. events
  8.         {
  9.                 use epoll;
  10.                 worker_connections 51200;
  11.         }

  12. http
  13.         {
  14.                 include       mime.types;
  15.                 default_type  application/octet-stream;

  16.                 server_names_hash_bucket_size 128;
  17.                 client_header_buffer_size 32k;
  18.                 large_client_header_buffers 4 32k;
  19.                 client_max_body_size 50m;

  20.                 sendfile on;
  21.                 tcp_nopush     on;

  22.                 keepalive_timeout 60;

  23.                 tcp_nodelay on;

  24.                 fastcgi_connect_timeout 300;
  25.                 fastcgi_send_timeout 300;
  26.                 fastcgi_read_timeout 300;
  27.                 fastcgi_buffer_size 64k;
  28.                 fastcgi_buffers 4 64k;
  29.                 fastcgi_busy_buffers_size 128k;
  30.                 fastcgi_temp_file_write_size 256k;
  31.                 fastcgi_intercept_errors on;

  32.                 gzip on;
  33.                 gzip_min_length  1k;
  34.                 gzip_buffers     4 16k;
  35.                 gzip_http_version 1.0;
  36.                 gzip_comp_level 2;
  37.                 gzip_types       text/plain application/x-javascript text/css application/xml;
  38.                 gzip_vary on;
  39.                 gzip_proxied        expired no-cache no-store private auth;
  40.                 gzip_disable        "MSIE [1-6]\.";

  41.                 #limit_zone  crawler  $binary_remote_addr  10m;

  42.                 server_tokens off;
  43.                 #log format
  44.                 log_format  access  '$remote_addr - $remote_user [$time_local] "$request" '
  45.              '$status $body_bytes_sent "$http_referer" '
  46.              '"$http_user_agent" $http_x_forwarded_for';

  47. server
  48.         {
  49.                 listen       80;
  50.                 server_name my.oks.net;
  51.                 index index.html index.htm index.php;
  52.                 error_page 404 = /404.htm
  53.                 root  /home/wwwroot/default;

  54.                 location ~ .*\.(php|php5)?$
  55.                         {
  56.                                 try_files $uri =404;
  57.                                 fastcgi_pass  unix:/tmp/php-cgi.sock;
  58.                                 fastcgi_index index.php;
  59.                                 include fcgi.conf;
  60.                         }

  61.                 location /status {
  62.                         stub_status on;
  63.                         access_log   off;
  64.                 }

  65.                 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  66.                         {
  67.                                 expires      30d;
  68.                         }

  69.                 location ~ .*\.(js|css)?$
  70.                         {
  71.                                 expires      12h;
  72.                         }

  73.                 access_log  /home/wwwlogs/access.log  access;
  74.         }
  75. include vhost/*.conf;
  76. }
复制代码
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2013-10-20 16:53:45 | 显示全部楼层


404设置上有问题 参考教程:https://bbs.vpser.net/viewthread.php?tid=2175

其他没错误,502按置顶帖排查
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 03:24 , Processed in 0.025302 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表