1 Star 1 Fork 1

wang5620079/mybookstore-front

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
nginx.conf 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
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 'server="$server_name" host="$host dest_port="$server_port"'
#'src="$remote_addr" ip="$realip_remote_addr" user="$remote_user" '
'time_local="$time_local" http_status="$status" '
'http_referer="$http_referer" http_user_agent="$http_user_agent" '
'http_x_forwarded_for="$http_x_forwarded_for" '
'http_x_header="$http_x_header" uri_query="$query_string" uri_path="$uri" '
'request=$request http_method="$request_method" ';
access_log /var/log/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
#设置resolver为coredns的地址,kubectl get svc -n kube-system -o wide
resolver 10.96.0.10 valid=10s ipv6=off;
resolver_timeout 10s;
server {
listen 80;
#测试环境主机ip地址作为host,未来还会改成ingress域名访问
server_name mybookstore-dev.my-site.com;
#动静分离
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
#使用集群内的mybookstore-app-svc服务,利用k8s的service域名解析和k8s的service的负载均衡能力,将压力分散到应用层的各个pod中
location /api/ {
set $backend mybookstore-app-svc.dev.svc.cluster.local;
proxy_pass http://$backend:5000;
}
#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;
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wang5620079/mybookstore-front.git
[email protected]:wang5620079/mybookstore-front.git
wang5620079
mybookstore-front
mybookstore-front
master

搜索帮助