当前位置: 首页 > news >正文

办个网站需要多少钱阿里云服务器

办个网站需要多少钱,阿里云服务器,网页在线代理翻墙,网站建设 工作方案最近项目中用到关于Nginx前后端分离部署spring boot和vue工程以及反向代理的配置,总结了一下说明: 1、后端是spring boot工程,端口8000,通过 jar命令启动 nohup java -jar xxx-jsonflow-biz.jar > /usr/local/nohup.out 2>…

最近项目中用到关于Nginx前后端分离部署spring boot和vue工程以及反向代理的配置,总结了一下说明:

1、后端是spring boot工程,端口8000,通过 jar命令启动

nohup java -jar xxx-jsonflow-biz.jar > /usr/local/nohup.out 2>&1 &

2、后台前端是vue工程,打包成dist文件夹,端口是13000,nginx配置如下:

    server {listen 13000;server_name localhost;gzip on;gzip_min_length 1k;gzip_comp_level 4;gzip_proxied any;gzip_types text/plain text/xml text/css;gzip_vary on;gzip_disable "MSIE [1-6]\.(?!.*SV1)";root /usr/local/nginx/html/dist;location ~* ^/jsonflow/ {#proxy_pass http://127.0.0.1:8000;proxy_connect_timeout 15s;proxy_send_timeout 15s;proxy_read_timeout 15s;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto http;#proxy_method GET POST PUT DELETE;add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Credentials 'true'; add_header Access-Control-Allow-Methods 'GET,PUT,POST,OPTIONS'; add_header Access-Control-Allow-Headers 'user-id,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';if ($request_method = 'OPTIONS') {return 204;}proxy_pass http://127.0.0.1:8000;}if ($request_uri ~ "/actuator"){return 403;}}

3、h5移动端是2个应用,配了2个server,分别对应h5文件夹下的2个目录,nginx配置如下:

    server {listen       9001;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;error_page 403 =200 /40x.html;location /40x.html {root html;}location / {root   html/h5/yiyuan;index  index.html ;}}server {listen       9002;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;error_page 403 =200 /40x.html;location /40x.html {root html;}location / {root   html/h5/yaodian;index  index.html ;}}

4、完整的nginx.conf配置文件如下:


#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 {map $http_upgrade $connection_upgrade {default upgrade;''      close;}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;server {listen       9001;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;error_page 403 =200 /40x.html;location /40x.html {root html;}location / {root   html/h5/yiyuan;index  index.html ;}}server {listen       9002;server_name  localhost;#charset koi8-r;#access_log  logs/host.access.log  main;error_page 403 =200 /40x.html;location /40x.html {root html;}location / {root   html/h5/yaodian;index  index.html ;}}server {listen 13000;server_name localhost;gzip on;gzip_min_length 1k;gzip_comp_level 4;gzip_proxied any;gzip_types text/plain text/xml text/css;gzip_vary on;gzip_disable "MSIE [1-6]\.(?!.*SV1)";root /usr/local/nginx/html/dist;location ~* ^/(jsonflow/ws) {proxy_pass http://127.0.0.1:8000;proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";}location ~* ^/jsonflow/ {#proxy_pass http://127.0.0.1:8000;proxy_connect_timeout 15s;proxy_send_timeout 15s;proxy_read_timeout 15s;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto http;#proxy_method GET POST PUT DELETE;add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Credentials 'true'; add_header Access-Control-Allow-Methods 'GET,PUT,POST,OPTIONS'; add_header Access-Control-Allow-Headers 'user-id,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';if ($request_method = 'OPTIONS') {return 204;}proxy_pass http://127.0.0.1:8000;}location ~* ^/(gen) {proxy_pass http://127.0.0.1:5003;proxy_connect_timeout 15s;proxy_send_timeout 15s;proxy_read_timeout 15s;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto http;}if ($request_uri ~ "/actuator"){return 403;}}
}

5、nginx目录如下图:

6、番外,关于https证书的配置:

	server {listen 443 ssl;server_name localhost;gzip on;gzip_static on;gzip_min_length 1k;gzip_comp_level 4;gzip_proxied any;gzip_types text/plain text/xml text/css;gzip_vary on;gzip_disable "MSIE [1-6]\.(?!.*SV1)";ssl_protocols GMTLSv1.1;ssl_certificate crt/gm/SS.pem;ssl_certificate_key crt/gm/SS.key.pem;ssl_certificate crt/gm/SE.pem;ssl_certificate_key crt/gm/SE.key.pem;root /usr/local/dist;location ~* ^/(ewaycloud) {proxy_pass http://127.0.0.1:8000;proxy_connect_timeout 60s;proxy_send_timeout 60s;proxy_read_timeout 60s;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_set_header X-Forwarded-Proto http;}}

http://www.hkea.cn/news/764665/

相关文章:

  • 新疆住房与建设厅网站新产品推广方式有哪些
  • 做网站站怎么赚钱网络营销模式有哪些?
  • 南通城市建设集团有限公司网站南京谷歌推广
  • 南通网站定制方案怎么查找关键词排名
  • 权大师的网站是哪个公司做的百度做个人简介多少钱
  • 烟台网站建设设计软文广告经典案例100字
  • 做微信用什么网站广州百度seo代理
  • 网站建设目标 优帮云跨境电商营销推广
  • 郑州华恩科技做网站怎么样竞价排名适合百度吗
  • flask做大型网站开发深圳seo博客
  • 合肥网站建设平台小程序怎么引流推广
  • 做网站被拘留免费找客源软件
  • 门户型网站建设百度seo快速提升排名
  • 印度做杂质的网站如何进行网络推广
  • 建设厅八大员兴安盟新百度县seo快速排名
  • 南京网站建设索q.479185700小说排行榜百度
  • 幼儿做爰网站seo工程师是什么职业
  • 申请空间 建立网站吗西安百度推广运营
  • 做花馍网站百度联盟
  • 沈阳建设企业网站google浏览器官网
  • 毕业论文 网站开发营销qq下载
  • 建网站要多长时间外贸网站优化
  • 苹果网站做的好的点电脑培训网上免费课程
  • 做网站开源互联网优化是什么意思
  • 模仿做网站b站上海热点新闻
  • phpcmsv9网站地图地推的60种方法
  • 湖南手机版建站系统哪个好百度网盘app怎么打开链接
  • asp网站开发的实训报告电商营销推广有哪些?
  • 交互设计流程外贸网站优化公司
  • 网络营销网站策划个人网站seo入门