全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 12599|回复: 6

求 /etc/nginx/nginx.conf 的默认配置

[复制链接]
发表于 2013-12-31 21:33:24 | 显示全部楼层 |阅读模式
求 /etc/nginx/nginx.conf 的默认配置,改的时候给改了,现在出错了。
发表于 2013-12-31 21:49:37 | 显示全部楼层
cat /etc/nginx/nginx.conf
发表于 2013-12-31 21:50:08 | 显示全部楼层
看看有没有_default.conf
文件
发表于 2013-12-31 21:59:16 | 显示全部楼层
有一个备份的在
发表于 2013-12-31 22:21:38 | 显示全部楼层

  1. #user  nobody;
  2. worker_processes  1;

  3. #error_log  logs/error.log;
  4. #error_log  logs/error.log  notice;
  5. #error_log  logs/error.log  info;

  6. #pid        logs/nginx.pid;


  7. events {
  8.     worker_connections  1024;
  9. }


  10. http {
  11.     include       mime.types;
  12.     default_type  application/octet-stream;

  13.     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  14.     #                  '$status $body_bytes_sent "$http_referer" '
  15.     #                  '"$http_user_agent" "$http_x_forwarded_for"';

  16.     #access_log  logs/access.log  main;

  17.     sendfile        on;
  18.     #tcp_nopush     on;

  19.     #keepalive_timeout  0;
  20.     keepalive_timeout  65;

  21.     #gzip  on;

  22.     server {
  23.         listen       80;
  24.         server_name  localhost;

  25.         #charset koi8-r;

  26.         #access_log  logs/host.access.log  main;

  27.         location / {
  28.             root   html;
  29.             index  index.html index.htm;
  30.         }

  31.         #error_page  404              /404.html;

  32.         # redirect server error pages to the static page /50x.html
  33.         #
  34.         error_page   500 502 503 504  /50x.html;
  35.         location = /50x.html {
  36.             root   html;
  37.         }

  38.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  39.         #
  40.         #location ~ \.php$ {
  41.         #    proxy_pass   http://127.0.0.1;
  42.         #}

  43.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  44.         #
  45.         #location ~ \.php$ {
  46.         #    root           html;
  47.         #    fastcgi_pass   127.0.0.1:9000;
  48.         #    fastcgi_index  index.php;
  49.         #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
  50.         #    include        fastcgi_params;
  51.         #}

  52.         # deny access to .htaccess files, if Apache's document root
  53.         # concurs with nginx's one
  54.         #
  55.         #location ~ /\.ht {
  56.         #    deny  all;
  57.         #}
  58.     }


  59.     # another virtual host using mix of IP-, name-, and port-based configuration
  60.     #
  61.     #server {
  62.     #    listen       8000;
  63.     #    listen       somename:8080;
  64.     #    server_name  somename  alias  another.alias;

  65.     #    location / {
  66.     #        root   html;
  67.     #        index  index.html index.htm;
  68.     #    }
  69.     #}


  70.     # HTTPS server
  71.     #
  72.     #server {
  73.     #    listen       443;
  74.     #    server_name  localhost;

  75.     #    ssl                  on;
  76.     #    ssl_certificate      cert.pem;
  77.     #    ssl_certificate_key  cert.key;

  78.     #    ssl_session_timeout  5m;

  79.     #    ssl_protocols  SSLv2 SSLv3 TLSv1;
  80.     #    ssl_ciphers  HIGH:!aNULL:!MD5;
  81.     #    ssl_prefer_server_ciphers   on;

  82.     #    location / {
  83.     #        root   html;
  84.     #        index  index.html index.htm;
  85.     #    }
  86.     #}

  87. }
复制代码
 楼主| 发表于 2013-12-31 22:22:50 | 显示全部楼层

大牛多谢,不过已有。
发表于 2013-12-31 22:24:07 | 显示全部楼层
  1. #user  nobody;
  2. worker_processes  1;

  3. #error_log  logs/error.log;
  4. #error_log  logs/error.log  notice;
  5. #error_log  logs/error.log  info;

  6. #pid        logs/nginx.pid;


  7. events {
  8.     worker_connections  1024;
  9. }


  10. http {
  11.     include       mime.types;
  12.     default_type  application/octet-stream;

  13.     #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
  14.     #                  '$status $body_bytes_sent "$http_referer" '
  15.     #                  '"$http_user_agent" "$http_x_forwarded_for"';

  16.     #access_log  logs/access.log  main;

  17.     sendfile        on;
  18.     #tcp_nopush     on;

  19.     #keepalive_timeout  0;
  20.     keepalive_timeout  65;

  21.     gzip  on;
  22.     gzip_http_version 1.0;
  23.     gzip_disable "MSIE [1-6].";
  24.     gzip_types text/plain application/x-javascript text/css text/javascript application/x-httpd-php image/jpeg image/gif image/png;

  25.     server {
  26.         listen       80;
  27.         server_name  localhost;

  28.         #charset koi8-r;

  29.         #access_log  logs/host.access.log  main;

  30.         location / {
  31.             root   html;
  32.             index  index.html index.htm index.php;
  33.         }

  34.         #error_page  404              /404.html;

  35.         # redirect server error pages to the static page /50x.html
  36.         #
  37.         error_page   500 502 503 504  /50x.html;
  38.         location = /50x.html {
  39.             root   html;
  40.         }

  41.         # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  42.         #
  43.         #location ~ \.php$ {
  44.         #    proxy_pass   http://127.0.0.1;
  45.         #}

  46.         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  47.         #
  48.         location ~ \.php$ {
  49.             root           /usr/local/nginx/html;
  50.             fastcgi_pass   127.0.0.1:9000;
  51.             fastcgi_index  index.php;
  52.             fastcgi_param  SCRIPT_FILENAME  /usr/local/nginx/html$fastcgi_script_name;
  53.             include        fastcgi_params;
  54.         }

  55.         # deny access to .htaccess files, if Apache's document root
  56.         # concurs with nginx's one
  57.         #
  58.         #location ~ /\.ht {
  59.         #    deny  all;
  60.         #}
  61.     }


  62.     # another virtual host using mix of IP-, name-, and port-based configuration
  63.     #
  64.     #server {
  65.     #    listen       8000;
  66.     #    listen       somename:8080;
  67.     #    server_name  somename  alias  another.alias;

  68.     #    location / {
  69.     #        root   html;
  70.     #        index  index.html index.htm;
  71.     #    }
  72.     #}


  73.     # HTTPS server
  74.     #
  75.     #server {
  76.     #    listen       443;
  77.     #    server_name  localhost;

  78.     #    ssl                  on;
  79.     #    ssl_certificate      cert.pem;
  80.     #    ssl_certificate_key  cert.key;

  81.     #    ssl_session_timeout  5m;

  82.     #    ssl_protocols  SSLv2 SSLv3 TLSv1;
  83.     #    ssl_ciphers  HIGH:!aNULL:!MD5;
  84.     #    ssl_prefer_server_ciphers   on;

  85.     #    location / {
  86.     #        root   html;
  87.     #        index  index.html index.htm;
  88.     #    }
  89.     #}

  90. }
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-5-6 16:54 , Processed in 0.061490 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

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