ini React.js Vue.js Nginx配置

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ini React.js Vue.js Nginx配置相关的知识,希望对你有一定的参考价值。


#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;
    server_tokens off;
    #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;
    gzip_min_length 1k;
    gzip_buffers 4 16k;
    gzip_comp_level 5;
    gzip_types application/javascript text/plain application/x-javascript text/css application/xml text/javascript;

    server {

        listen       80;
        server_name  localhost;
        root         /www/html;

        charset utf-8;

        # access_log  logs/host.access.log  main;

        location / {
            try_files $uri /index.html;
        }

			location ~*  \.(jpg|jpeg|png|gif|ico|css|js|svg|js|css)$ {
					gzip_static on;
					expires max;
				}
			}
    }
}

以上是关于ini React.js Vue.js Nginx配置的主要内容,如果未能解决你的问题,请参考以下文章

React.js与Vue.js:流行框架的比较

在 Vue.js 中使用 React-table.js 时出错

React.js or Vue.js

Vue.js与React的全面对比

React.js与Vue.js:流行框架的比较

React.js和Vue.js的语法并列比较