常用配置如下:
server {
listen 443 ssl;
server_name h5.cbi360.net;
include vhost/ssl.conf;
if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
set $year $1;
set $month $2;
set $day $3;
}
access_log /mnt/logs/mas.cbi360.net/$year-$month-$day-access.log;
error_log /mnt/logs/mas.cbi360.net/error.log error;
location / {
root /mnt/project/h5-cbi360-net/dist;
try_files $uri $uri/ /index.html;
}
location ^~ /api/ {
proxy_pass http://apiappop.cbi360.net/;
}
}
server {
listen 80;
server_name h5.cbi360.net;
return 301 https://h5.cbi360.net$request_uri;
}