vue前后分离项目部署(不同端口号,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; #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 18888;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root D:/nginx-1.16.0/html/cbdm;
index index.html index.htm;
try_files $uri $uri/ /index.html;
} location /cbdm/ {
proxy_pass http://192.168.13.129:28888; // 接口代理
} #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;
# 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;
# }
#} }
vue前后分离项目部署(不同端口号,nginx反向代理解决跨域问题)的更多相关文章
- VUE线上通过nginx反向代理实现跨域
1.NGINX反向代理实现跨域 VUE代码中配置参考上一篇文章 nginx配置,红色框线内: 代码: location /list { proxy_set_header X-Real-IP $remo ...
- vue反向代理解决跨域
问题描述 在项目开发的时候,接口联调的时候一般都是同域名下,且不存在跨域的情况下进行接口联调,但是当我们现在使用vue-cli进行项目打包的时候,我们在本地启动服务器后,比如本地开发服务下是 http ...
- 项目部署问题:xftp无法连接服务器、Nginx403 Forbidden解决、nginx反向代理解决前端跨域问题
一.xftp无法连接服务器 在xftp中配置正确的ip,用户名和密码后,居然无法连接 解决方案:将协议里面的FTP换成SFTP,注意换成SFTP后端口就默认换成22,要还是原来的21就还是连不上的哈 ...
- VUE前端项目配置代理解决跨域问题
VUE前端项目配置代理解决跨域问题 问题如下,经常在本地调试接口出现这种问题 解决方式1:Chrome 的扩展插件 以前使用Chrome 的扩展插件,但是有时候还是会出现莫名其妙的问题. 需要梯子才行 ...
- vue项目配置及代理解决跨域
axios数据请求 1.下载模块:npm install axios 2.axios特点: 1.支持在浏览器当中发起XMLHttpRequest请求 2.支持Promise 3.自动转换json数据 ...
- 搞懂:前端跨域问题JS解决跨域问题VUE代理解决跨域问题原理
什么是跨域 跨域:一个域下的文档或脚本试图去请求另一个域下的资源 广义的跨域包含一下内容: 1.资源跳转(链接跳转,重定向跳转,表单提交) 2.资源请求(内部的引用,脚本script,图片img,fr ...
- Kestrel 服务器部署多站点问题 (nginx 反向代理)
Kestrel 作为微软的跨平台 web 服务器,有些地方用的好不是很熟. 作为一款嵌套到 dll 中的进程级 web 服务器,在同一台服务器上部署多站点确实还存在一点问题. 今天采用 nginx 做 ...
- vue-webpack项目本地开发环境设置代理解决跨域问题
前言: 一般跨域问题只要后端配置好的话,是不需要前端做处理的,但也不能保证你遇到的所有后端都能很好的处理这个问题,这个时候可能就需要前端设置代理解决这个问题了. 配置方法: 1. config/ind ...
- .netcore部署Linux并结合Nginx反向代理 get started
一..NetCore网站准备与发布 首先准备好一个ASP.NET Core Web应用程序,我这里就使用新建的示例站点作为demo演示,使用dotnet publish 命令发布网站. 或者使用VS的 ...
随机推荐
- Ace-Admin框架-首页(一)
ACE-Admin是一个强大的后台模板框架,看起来非常漂亮,但是每个页面内容太多,看起来不知道怎么修改,现在来对首页进行主要内容改装,将不需要的内容都给删除,然后就只剩下一个框架,在开发中,我们就完全 ...
- Python绘制语谱图+时域波形
"""Python绘制语谱图""" """Python绘制时域波形""" # 导 ...
- logging,包
包 import 方式 所有对包的操作,都相当于对包下的__init__操作 from a.b.c import d b 必须 是包 import 最后只有一个层级 相对导入 . 代表当前路径, .. ...
- 带你全面了解高级 Java 面试中需要掌握的 JVM 知识点
目录 JVM 内存划分与内存溢出异常 垃圾回收算法与收集器 虚拟机中的类加载机制 Java 内存模型与线程 虚拟机性能监控与故障处理工具 参考 带你全面了解高级 Java 面试中需要掌握的 JVM 知 ...
- Spring入门配置(一) - IOC
一.初始命名空间配置 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="h ...
- HDU 5792:World is Exploding(树状数组求逆序对)
http://acm.hdu.edu.cn/showproblem.php?pid=5792 World is Exploding Problem Description Given a sequ ...
- Java读写二进制数据
import java.io.*; import java.time.LocalDate; public class Test { public static void main(String[] a ...
- Mllib数据类型(密集向量和稀疏向量)
1.局部向量 Mllib支持2种局部向量类型:密集向量(dense)和稀疏向量(sparse). 密集向量由double类型的数组支持,而稀疏向量则由两个平行数组支持. example: 向量(5.2 ...
- pycharm install python packaging tools时遇到AttributeError: '_NamespacePath' object has no attribute 'sort'错误
pycharm install python packaging tools时报错AttributeError: '_NamespacePath' object has no attribute 's ...
- 查看http请求的header信息
1 下载chrome浏览器 chrome浏览器是google开发的一块非常绑定浏览器.chrome浏览器下载地址. 2 通过chrome控制台查看http请求的header信息 2.1 打开chrom ...