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

山东建设公司网站外贸网站分类

山东建设公司网站,外贸网站分类,某公司网页设计,谷歌浏览器官网下载说明一下#xff1a; 本人原本使用的是docker安装nginx通过挂载实现部署#xff0c;但是出现了很多bug#xff08;例如部署安全证书后还是无法访问#xff09;#xff0c;所以困扰了很久#xff0c;最后改为本地安装nginx#xff0c;最终在不懈的努力下终于按照好了 本人原本使用的是docker安装nginx通过挂载实现部署但是出现了很多bug例如部署安全证书后还是无法访问所以困扰了很久最后改为本地安装nginx最终在不懈的努力下终于按照好了特此记录一下。 一整个流程 1. 将前端项目打包会生成dist文件同时不要忘了修改调用后台的ip 2. 安装nginx本地安装非docker然后将dist下的文件放入nginx的html目录下 3. 配置nginx的配置文件 4. 安装证书ssl 安装nginxssl参考https://blog.csdn.net/oYingJie1/article/details/127700897 下载及安装ssl参考https://blog.csdn.net/qq_42320934/article/details/120655799 二 附上关键代码及说明 1.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 80;server_name localhost;#将所有HTTP请求通过rewrite指令重定向到HTTPS。rewrite ^(.*)$ https://$host$1;#charset koi8-r;#access_log logs/host.access.log main;location / {root html;index index.html index.htm;}location /undefined/ {proxy_pass http://s11.s100.vip:35053;proxy_redirect default;rewrite ^/undefined/(.*) /$1 break;}#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 Apaches document root# concurs with nginxs 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;}location /undefined/ {proxy_pass http://s11.s100.vip:35053;proxy_redirect default;rewrite ^/undefined/(.*) /$1 break;}}}2. 以前docker配置的文件 user nginx; worker_processes auto;error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid;events {worker_connections 1024; }http {include /etc/nginx/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 /var/log/nginx/access.log main;sendfile on;#tcp_nopush on;keepalive_timeout 65;#gzip on;include /etc/nginx/conf.d/*.conf;server {listen 80;listen [::]:80;server_name www.slgstu.top;#将所有HTTP请求通过rewrite指令重定向到HTTPS。 # rewrite ^(.*)$ https://$host$1;#access_log /var/log/nginx/host.access.log main;location / {root /usr/share/nginx/html;index index.html index.htm;}location /undefined/ {proxy_pass http://s11.s100.vip:35053;proxy_redirect default;rewrite ^/undefined/(.*) /$1 break;}#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 /usr/share/nginx/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 Apaches document root# concurs with nginxs one##location ~ /\.ht {# deny all;#} }server {#HTTPS的默认访问端口443。#如果未在此处配置HTTPS的默认访问端口可能会造成Nginx无法启动。listen 443 ssl;#填写证书绑定的域名server_name www.slgstu.top;#填写证书文件名称ssl_certificate cert/www.slgstu.top.cer;#填写证书私钥文件名称ssl_certificate_key cert/www.slgstu.top.key;ssl_session_cache shared:SSL:1m;ssl_session_timeout 5m;# 指定密码为openssl支持的格式ssl_protocols SSLv2 SSLv3 TLSv1.2;ssl_ciphers HIGH:!aNULL:!MD5; # 密码加密方式ssl_prefer_server_ciphers on; # 依赖SSLv3和TLSv1协议的服务器密码将优先于客户端密码location / {root /usr/share/nginx/html;index index.html index.htm;} }} 3.说明下nginx的文件作用 cert放https证书的两个文件 conf nginx的一些配置文件主要还是使用nginx.conf html默认的话nginx会加载html文件下的index.html log查看成功与错误日志
http://www.sczhlp.com/news/213003/

相关文章:

  • 企业网站如何建立电商软文广告经典案例
  • 网站专题页怎么做怎样才能把网站宣传做的更好
  • 单品商城网站源码php网站开发技术期末题库
  • 快速网站仿制网络设计案例题
  • 网站建设汇报书 ppt如何建设好营销网站
  • ps怎么做网站首页自己做网站需要学什么东西
  • 网站开发视频 百度云石景山网站建设多少钱
  • 洛阳建站哪家好聊城做网站公司聊城博达
  • 盐城市网站合肥瑶海区医院
  • 手机网站和电脑网站样式的区别石家庄代运营公司
  • 网站改版 总结网站建设服务市场分析
  • 网站建设产品经理职责新闻门户网站是什么
  • 微信app网站策划方案免费网站
  • 网站前端开发流程建设会员网站需要多少钱
  • 用DW做的网站生成链接石家庄新闻主持人
  • sp681网卡打驱动后的状态--默认是链路是down
  • 利用Python写函数,判断用户传入的对象(字符串、列表、元组)长度是否大于5。
  • 广州白云区做网站seo网址
  • 平面设计网站大全有哪些wordpress如何添加广告
  • 网站编程培训哪好999网站免费
  • 博客网站素材棋牌软件开发工作室
  • 网站站长统计怎么做温州开发网站公司哪家好
  • 公司备案证查询网站查询网站qq登陆wordpress
  • 北京网站软件制作360网站排名优化
  • 世界服装鞋帽网免费做网站站长工具关键词查询
  • 企业网站要怎么做青岛做网站企业排名
  • 阜阳公司网站建设做英文小说网站
  • 网站建设开发企业seo深圳网络推广
  • 网站被拔毛的原因专业网站建设工作室
  • 做通路富集分析的网站微网站建站