worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#error_log logs/error.log debug;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
# HTTP服务
http {
include mime.types;
default_type application/octet-stream;
keepalive_timeout 65;
#access_log logs/access.log main;
server {
listen 8080;
server_name localhost;
location / {
root D:/soft/nginx-rtmp/html/cetcivs/dist/;
index index.html index.htm;
}
location /videoAction {
proxy_pass http://127.0.0.1:8800/video;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
}
location /content {
if ($request_filename ~* .*\.(?:png)$) ## 配置页面不缓存html和htm结尾的文件
{
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
root E:\market\marketstatic;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
}
server {
listen 8088; # 监听端口
server_name localhost;
#管理后台服务
location /content {
if ($request_filename ~* .*\.(?:png)$) ## 配置页面不缓存html和htm结尾的文件
{
add_header Cache-Control "private, no-store, no-cache, must-revalidate, proxy-revalidate";
}
root E:\market\marketstatic;
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
}
}
}
nginx使用
最新推荐文章于 2025-04-27 23:23:17 发布