首页 > 其他分享 >ngnix conf配置 vue router

ngnix conf配置 vue router

时间:2023-01-03 13:55:31浏览次数:39  
标签:index log ngnix server ssl location conf error router


#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       8008;
        server_name  localhost;

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

        location /data  {
            charset gbk,utf-8;
            autoindex on;
            autoindex_exact_size off;
            autoindex_localtime on;
            limit_rate_after 10m;
            alias D:\cpc_log_pic_video;
            allow all;
        }

    }


    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    server {
        listen       9998;
        server_name  localhost;

        location / {
            root   src/cpc_v1;
            try_files $uri $uri/ @router;
            index  index.html index.htm;
        }
        location @router {
            rewrite ^.*$ /index.html last;
        }

        location  /api {
            proxy_pass http://127.0.0.1:9999;
        }
    }


    # HTTPS server
    #
    #server {
    #    listen       443 ssl;
    #    server_name  localhost;

    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_cache    shared:SSL:1m;
    #    ssl_session_timeout  5m;

    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers  on;

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

}

标签:index,log,ngnix,server,ssl,location,conf,error,router
From: https://www.cnblogs.com/zhuoss/p/17021868.html

相关文章