NGINX代理的配置(简单易用版本)
首先说下nginx把,这个其实也是作为代理的,之前用的是vuecli3/4进行的代理配置,之前一直没有调通(后来必须要弄明白,可以看我的另一个文章。),就临时采用了nginx的方式进行本地的代理,我这里的代理方式是针对前端的开发模式的,因为针对服务器的比较多,所以我就不一一说明了。
首先需要下载nginx的项目工具,我用的版本是nginx-1.16.1
找到在当前目录下的/config/nginx.conf文件 ,用编辑器打开。
这里要区分一下你的需要代理的是http还是Https,我这里以http为例:
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