前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >服务器监控配置文件备份

服务器监控配置文件备份

原创
作者头像
无敌小菜鸟
修改2021-09-02 18:16:22
2.2K0
修改2021-09-02 18:16:22
举报
文章被收录于专栏:搬砖笔记搬砖笔记

nginx配置文件

代码语言:javascript
复制
#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


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

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

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  tz.990520.xyz;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            # proxy_pass http://127.0.0.1:8008;
            # proxy_set_header Host $host;
   	    rewrite ^(.*)$ https://$host$1 permanent;
        }
        location /ws {
	   # proxy_pass http://127.0.0.1:8008;
	   # proxy_http_version 1.1;
	   # proxy_set_header Upgrade $http_upgrade;
	   # proxy_set_header Connection "Upgrade";
	   # proxy_set_header Host $host;
	    rewrite ^(.*)$ https://$host$1 permanent;
	}
        #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   html;
        }

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

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    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       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}


    # HTTPS server
    server {
	listen      443;
       	ssl on;
	server_name tz.990520.xyz;
	ssl_certificate /usr/local/nginx/1_tz.990520.xyz_bundle.crt;
	ssl_certificate_key /usr/local/nginx/2_tz.990520.xyz.key;
	location / {
            proxy_pass http://127.0.0.1:8008;
            proxy_set_header Host $host;
	}
	location /ws {
            proxy_pass http://127.0.0.1:8008;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "Upgrade";
            proxy_set_header Host $host;
	}
	error_page 404 /404.html; 
	location = /40x.html {
	} 
	error_page 500 502 503 504 /50x.html; 
	location = /50x.html { 

	}
    }
}

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • nginx配置文件
相关产品与服务
云服务器
云服务器(Cloud Virtual Machine,CVM)提供安全可靠的弹性计算服务。 您可以实时扩展或缩减计算资源,适应变化的业务需求,并只需按实际使用的资源计费。使用 CVM 可以极大降低您的软硬件采购成本,简化 IT 运维工作。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档