nginx 配置 解决 vue history模式下空白 ,以及SSL证书安装

Posted 前端面试题库助手

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx 配置 解决 vue history模式下空白 ,以及SSL证书安装相关的知识,希望对你有一定的参考价值。

#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;




# 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;
#
#



# HTTPS server //自定义HTTPS配置
server
listen 443 ssl;
server_name www.55776.club; #你的域名
root html; #你的网站根目录
index index.php index.html index.htm; #网站默认访问文件

ssl_certificate ../cert/55.crt;
ssl_certificate_key ../cert/55.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;

location /
root html;
try_files $uri $uri/ /baiyi/$query_string;


location ~ \\.php(.*)$ #HP必须的配置,否则浏览器访问会直接下载php源码文件
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;





server
listen 80 ssl;
server_name www.55776.club;

#charset koi8-r;
#access_log logs/host.access.log main;

root html/baiyi; #你的网站根目录
index index.php index.html index.htm; #网站默认访问文件

location /
root html;
#index index.html index.htm;
try_files $uri $uri/ /baiyi/$query_string;

#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 nginx 配置 解决 vue history模式下空白 ,以及SSL证书安装

nginx 部署vue项目,路由模式为history时,页面刷新404问题

Vue项目history模式下nginx如何配置

vue路由history模式刷新404问题解决方案

vue路由history模式刷新404问题解决方案

Nginx vue 多单页 history路由模式 配置