1. /etc/nginx/sites-enabled/default 的原始文件

# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file ##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
## server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on; root /home/guanzhou/biangz_work/purchase/dev/;
index index.html index.htm; # Make site accessible from http://localhost/
server_name localhost; location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
} # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
#location /RequestDenied {
# proxy_pass http://127.0.0.1:8080;
#} #error_page 404 /404.html; # redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
server {
listen 8001;
# listen somename:8080;
# server_name somename alias another.alias;
server_name localhost;
root /home/guanzhou/RubymineProjects/console/purchase/dev;
index index.html index.htm; location / {
try_files $uri $uri/ =404;
}
} # HTTPS server
#
#server {
# listen 443;
# server_name localhost;
#
# root html;
# index index.html index.htm;
#
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
#
# ssl_session_timeout 5m;
#
# ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
# ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
# ssl_prefer_server_ciphers on;
#
# location / {
# try_files $uri $uri/ =404;
# }
#}

2. nginx.conf

user www-data;
worker_processes 4; pid /run/nginx.pid; events {
worker_connections 768;
#multi_accept on;
} http { ##
# Basic Settings
## sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
#server_tokens off; #server_names_hash_bucket_size 64;
#server_name_in_redirect off; include /etc/nginx/mime.types;
default_type application/octet-stream; ##
# Logging Settings
## access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log; ##
# Gzip Settings
## gzip on;
gzip_disable "msie6"; # gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; ##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
## #include /etc/nginx/naxsi_core.rules; ##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
## #passenger_root /usr;
#passenger_ruby /usr/bin/ruby; ##
# Virtual Host Configs
## include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
} #mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}

  

  

nginx 配置文件备份的更多相关文章

  1. nginx 配置文件备份 nginx.conf and vhosts

    bogon:vhosts xingchong$ brew services restart nginx Stopping `nginx`... (might take a while) ==> ...

  2. 前端必备 Nginx 配置

    Nginx (engine x) 是一个轻量级高性能的HTTP和反向代理服务器,同时也是一个通用 代理服务器 (TCP/UDP/IMAP/POP3/SMTP),最初由俄罗斯人Igor Sysoev编写 ...

  3. Nginx配置Https(详细、完整)

    Nginx配置Https(详细.完整) 原文链接:请支持原创 前置条件: 在配置https之前请确保下面的步骤已经完成 服务器已经安装nginx并且通过http可以正常访问 不会安装nginx的可以参 ...

  4. nginx配置反向代理或跳转出现400问题处理记录

    午休完上班后,同事说测试站点访问接口出现400 Bad Request  Request Header Or Cookie Too Large提示,心想还好是测试服务器出现问题,影响不大,不过也赶紧上 ...

  5. Windos环境用Nginx配置反向代理和负载均衡

    Windos环境用Nginx配置反向代理和负载均衡 引言:在前后端分离架构下,难免会遇到跨域问题.目前的解决方案大致有JSONP,反向代理,CORS这三种方式.JSONP兼容性良好,最大的缺点是只支持 ...

  6. Windows下Nginx配置SSL实现Https访问(包含证书生成)

    Vincent.李   Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...

  7. Nginx 配置简述

    不论是本地开发,还是远程到 Server 开发,还是给提供 demo 给人看效果,我们时常需要对 Nginx 做配置,Nginx 的配置项相当多,如果考虑性能配置起来会比较麻烦.不过,我们往往只是需要 ...

  8. Nginx配置详解

    序言 Nginx是lgor Sysoev为俄罗斯访问量第二的rambler.ru站点设计开发的.从2004年发布至今,凭借开源的力量,已经接近成熟与完善. Nginx功能丰富,可作为HTTP服务器,也 ...

  9. Nginx配置Https

    1.申请证书: https://console.qcloud.com/ssl?utm_source=yingyongbao&utm_medium=ssl&utm_campaign=qc ...

随机推荐

  1. Canvas 唯美雨落代码实现

    <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...

  2. smartlink

    链接:https://www.zhihu.com/question/21783165/answer/20323202 Wi-Fi本身是属于固定频段上的TDD通讯机制,目前尚用的也就是2.4G和5.8G ...

  3. php课程---数组

    数组:    一:定义 1.赋值定义    $arr[0] = 5;    $arr[1] = "aa";        print_r ($arr); 2.定义索引数组    $ ...

  4. JS开发windows phone8.1系列之1

    http://msdn.microsoft.com/zh-cn/library/windows/apps/dn629638.aspx,要点: 1.了解项目结构:package.appxmanifest ...

  5. poj2305-Basic remains(进制转换 + 大整数取模)

    进制转换 + 大整数取模一,题意: 在b进制下,求p%m,再装换成b进制输出. 其中p为b进制大数1000位以内,m为b进制数9位以内二,思路: 1,以字符串的形式输入p,m; 2,转换:字符串-&g ...

  6. [转]MongoDB学习 C#驱动操作MongoDB

    下载驱动 驱动的下载有两种方式:一种是在C#项目中通过NuGet进行安装,另一种是通过下面的链接:https://github.com/mongodb/mongo-csharp-driver/rele ...

  7. Java类成员(成员变量和方法)的覆盖与隐藏归纳

    以前就知道重写override和重载overload的区别,平时也是逮着用就是了,Eclipse报错再说. 最近看一本书里面出现了重写.替换.覆盖.置换.隐藏.重载,简直乱得不行,归纳整理一下. 从全 ...

  8. Composer : php依赖管理工具

    原始时代 我记得在当时用php的时候还没有composer,只有个pear,但是不好用呀,还不如直接在互联网上到处复制代码了,更快更不容易出错,当时也没有github这么好的社区工具了 总结如下 代码 ...

  9. 将类型(int,string,…)转换为 T 类型

    方法定义: private static T GetValueByKey<T>(string key) where T : IConvertible { T localVal=defaul ...

  10. SQLSERVER2012 附加数据库重名的问题

    SQL2012附加数据库时如何更改数据库名称呢 方法一: 在“附加为”那一栏填写新的数据库名称就可以 方法二: 使用脚本 附加时点击脚本会自动生成附加脚本 直接修改database的名称即可!