栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

nginx

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

nginx

生产安装nginx 1.18
user  nginx;
worker_processes  1;

error_log  /data/nginx/log/error.log warn;
pid        /data/nginx/pid/nginx.pid;

#daemon off; 

events {
    worker_connections  1024;
}


http {
    include       /data/nginx/etc/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  /data/nginx/log/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    #gzip  on;
    
    server {
        listen       8099;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location ^~ /admin-bwg {
                add_header Cache-Control 'no-cache, must-revalidate, proxy-revalidate, max-age=0';
                alias /data/web/admin-bwg/;
                try_files $uri $uri/ /admin-bwg/index.html;
        }
		
	location ^~ /single-login {
                add_header Cache-Control 'no-cache, must-revalidate, proxy-revalidate, max-age=0';
                alias /data/web/app-single-login/;
                try_files $uri $uri/ /single-login/success.html;
        }
    }


    #include /etc/nginx/conf.d/*.conf;
}

[Unit]
Description=nginx - high performance web server
documentation=http://nginx.org/en/docs/
After=network-online.target remote-fs.target nss-lookup.target
Wants=network-online.target

[Service]
Type=forking
PIDFile=/data/nginx/pid/nginx.pid
ExecStart=/usr/sbin/nginx -c /data/nginx/etc/nginx.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID

[Install]
WantedBy=multi-user.target                             
mkdir /data/nginx/{etc,bin,log,pid,cache} -p
ln -sv /data/nginx/bin/nginx   /usr/sbin/nginx
chown nginx.nginx  -R /data/nginx/
vim /usr/lib/systemd/system/nginx.service
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/277398.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号