1.配置静态资源
server {
listen 80;
server_name localhost;
rewrite ^(.*) https://$server_name$1 permanent;
#charset koi8-r;
#access_log logs/host.access.log main;
#location / {
#proxy_pass http://hello; #在这里设置一个代理,和upstream的名字一样
#root html;
#index index.html index.htm;
#}
location /app/ {
root /app/war/hospital;
index index.html;
}
}
2. // 将静态资源放入/app/war/hospital 对应目录
3.nginx 配置https配置
server {
listen 443 ssl;
server_name localhost;
root html;
index index.html index.htm;
ssl_certificate 对应证书的crt;
ssl_certificate_key 对应证书的key;
location / {
proxy_pass http://localhost:8080/;
}
}