#user nobody;
worker_processes 4;
#worker_cpu_affinity 0001 0010 0100 1000;
worker_rlimit_nofile 65535;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pidnginx.pid;
events {
#use epoll;
worker_connections 65535;
}
http {
include mime.types;
default_type application/octet-stream;
log_format stone '$remote_addr - - [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"';
#access_log off;
# access_log /usr/local/nginx/logs/access.log stone;
access_log logs/access.log;
sendfileon;
tcp_nopushon;
tcp_nodelayon;
fastcgi_intercept_errors on;
keepalive_timeout 60;
proxy_connect_timeout 60;
proxy_read_timeout 60;
proxy_send_timeout 60;
proxy_buffer_size 256k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
proxy_temp_file_write_size 256k;
#proxy_temp_path /home/data/proxy_temp;
proxy_temp_path F:/nginx-1.12.0/data/logsproxy_temp;#自己找到nginx安装目录建文件夹
#proxy_cache_path D:/nginx-1.12.0/data/proxy_cache levels=1:2 keys_zone=cache_one:64m inactive=1d max_size=1g;
client_header_buffer_size 4k;
large_client_header_buffers 4 8k;
client_max_body_size 2m;
gzip on;
gzip_disable "MSIE [1-6]\.";
gzip_min_length 1k;
gzip_comp_level 4;
gzip_buffers 4 8k;
gzip_typestext/plain application/javascript application/x-javascript text/css text/javascript application/x-httpd-php image/jpeg image/gif image/png;
#gzip on;
server {
listen 80;
server_name localhost;
server_tokens off;
userid on;
userid_name uid;
userid_expires 730d;
userid_p3p 'policyref="/w3c/p3p.xml", CP="CUR ADM OUR NOR STA NID"';
#access_log off;
# access_log /usr/local/nginx/logs/stone-access.log stone buffer=8k flush=500ms;
# error_log /usr/local/nginx/logs/stone-error.log crit;
access_log logs/stone-access.log stone buffer=8k flush=500ms;
error_log logs/stone-error.log;
#charset koi8-r;
#access_log logs/host.access.log main;
if ($http_user_agent ~* "MQQBrowser/5.0 QQ-URL-Manager Mobile"){
return 404;
}
#栏目
# 修改Cas的配置开始
rewrite ^/$ /main/index.html last;
rewrite ^/index\.html.*? /main/index.html last;
# 修改Cas的配置结束
rewrite ^/live\.html$ /main/live.html last;
rewrite ^/finance\.html$ /main/finance.html last;
rewrite ^/zhuanji\.html$ /main/zhuanji.html last;
rewrite ^/teacherlist\.html$ /teacher/teacherlist.html last;
#视频
rewrite ^/video/([0-9]+)\.html$ /video/dianbo.html?vid=$1&segid=0 last;
rewrite ^/video/([0-9]+)/([0-9]+)\.html$ /video/dianbo.html?vid=$1&segid=$2 last;
#视频列表
rewrite ^/video/fresh/([0-9]+)\.html$ /video/fresh.html?pagenum=$1 last;
rewrite ^/video/strength/([0-9]+)\.html$ /video/strength.html?pagenum=$1 last;
rewrite ^/video/weekend/([0-9]+)\.html$ /video/weekend.html?pagenum=$1 last;
rewrite ^/video/strategy/([0-9]+)\.html$ /video/strategy.html?pagenum=$1 last;
rewrite ^/video/knowledge/([0-9]+)\.html$ /video/knowledge.html?pagenum=$1 last;
rewrite ^/video/latest/([0-9]+)\.html$ /video/latest.html?pagenum=$1 last;
#直播互动中奖列表
rewrite ^/live/reward/([0-9]+)\.html$ /live/reward.html?pagenum=$1 last;
#讲师
rewrite ^/teacher/([0-9]+)\.html$ /teacher/detail.html?tid=$1&pagenum=1 last;
rewrite ^/teacher/([0-9]+)/([0-9]+)\.html$ /teacher/detail.html?tid=$1&pagenum=$2 last;
rewrite ^/teacherlist/([0-9]+)\.html$ /teacher/teacherlist.html?pagenum=$1 last;
#视频搜索
rewrite ^/video/search/([^/]*?)\.html$ /video/search.html?keyword=$1&pagenum=1 last;
rewrite ^/video/search/([^/]*?)/([0-9]+)\.html$ /video/search.html?keyword=$1&pagenum=$2 last;
#讲师搜索
rewrite ^/teacher/search/([^/]*?)\.html$ /teacher/search.html?keyword=$1&pagenum=1 last;
rewrite ^/teacher/search/([^/]*?)/([0-9]+)\.html$ /teacher/search.html?keyword=$1&pagenum=$2 last;
#聊天室地址获取
rewrite ^/checkChat\.jsp$ /server/livechat.html last;
rewrite ^/vodcheck/([0-9]+)/([0-9]+)\.html$ /video/vodcheck.html?vid=$1&segid=$2 last;
rewrite ^/videoaddr/([0-9]+)/([0-9]+)\.html$ /video/videoaddr.html?vid=$1&segid=$2 last;
#动态公告列表
rewrite ^/notice/list/([0-9]+)\.html$ /notice/list.html?pagenum=$1 last;
rewrite ^/notice/([0-9]+)\.html$ /notice/detail.html?noticeid=$1 last;
#股票搜索
rewrite ^/stock/search/([0-9]+)\.html$ /stock/search.html?code=$1 last;
#麟龙软件
rewrite ^/linlong\.html$ /linlong/softlive.html last;
rewrite ^/softlive\.html$ /linlong/softlive.html last;
rewrite ^/product\.html$ /linlong/clionsoft.html last;
rewrite ^/product/([0-9]+)\.html$ /linlong/product.html?softid=$1 last;
rewrite ^/clionsoft\.html$ /linlong/clionsoft.html last;
rewrite ^/qitiandasheng\.html$ /linlong/qitiandasheng.html last;
rewrite ^/softvideo\.html$ /linlong/jiangtang.html last;
rewrite ^/jiangtang\.html$ /linlong/jiangtang.html last;
rewrite ^/qiyoucili\.html$ /linlong/qiyoucili.html last;
rewrite ^/download\.html$ /linlong/download.html last;
rewrite ^/stocksearch/([0-9]+)\.html$ /linlong/stocksearch.html?code=$1 last;
#视频列表
rewrite ^/videolist/([0-9]+)\.html$ /linlong/videolist.html?type=$1 last;
rewrite ^/videolist/([0-9]+)/([0-9]+)\.html$ /linlong/videolist.html?type=$1&pagenum=$2 last;
#中奖列表
rewrite ^/rewardlist\.html$ /linlong/rewardlist.html last;
rewrite ^/rewardlist/([0-9]+)\.html$ /linlong/rewardlist.html?pagenum=$1 last;
#股票决策信息搜索
rewrite ^/stocksearch/([0-9]+)\.html$ /linlong/stocksearch.html?code=$1 last;
#订单购买流程
rewrite ^/purchase/([0-9]+)\.html$ /linlong/purchase.html?softid=$1 last;
rewrite ^/payment/([0-9]+)\.html$ /linlong/payment.html?softid=$1 last;
rewrite ^/payresult.html(.*) /linlong/payresult.html$1 last;
rewrite ^/paynotify.html(.*) /linlong/paynotify.html$1 last;
location / {
add_header Cache-Control no-cache;
add_header Cache-Control private;
proxy_pass http://stonesvr1;
}
location ^~ /help/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /images/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /css/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /js/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /kkplayer/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /linlong/images/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /linlong/js/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /linlong/css/ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ^~ /favicon.ico {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ~ ^/(login|regist|registok|404)\.html$ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
location ~ .*\.swf$ {
root D:/dev/nginx-1.8.0/nginxRoot/;
}
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_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Referer $http_referer;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
upstream stonesvr1 {#访问名称
ip_hash;#负载均衡算法
#server 172.27.60.21:1234; #停掉的一个节点
server 172.27.60.22:1234;#网站后台的访问地址(开启的第二个节点)
}
}
1. 到nginx安装目录
2. 按住shift+鼠标右键
3. 点击"在此处打开命令窗口"
4. 输入 start nginx
5. 到nginx目录下logs文件夹,查看error.log。
start nginx
相关推荐
Notepad++ 自定义 nginx.conf 文件语法高亮的配置文件 使用教程:点击语言-自定义语言格式-导入(下载的xml文件)-重启notepad++,即可使用
nginx.conf配置文件下载
nginx.conf配置文件,反向代理,负载均衡--轮询、权重、IPHASH等
nginx1.21.5 nginx.conf配置文件
Nginx.conf 配置文件是 Nginx 服务器的核心配置文件,通过该文件可以对 Nginx 服务器的行为进行详细的配置。 error_log 日志 error_log 是 Nginx 的一种日志类型,用于记录 Nginx 服务器的错误信息。error_log ...
Nginx配置文件(nginx.conf)配置详解 Nginx配置文件(nginx.conf)是Nginx服务器的核心配置文件,用于定义Nginx服务器的行为和配置。下面是Nginx配置文件的详细配置解释: 用户和组 Nginx配置文件中指定了用户和组,...
django项目上线时完整的nginx.conf文件,直接覆盖上去,修改域名和项目路径就OK了,直接拿走就好,详细部署上线流程我的博客里油介绍
1、对nginx中的一些经典节点注释。2、节点有user、worker_processes、error_log、pid、worker_rlimit_nofile、worker_connections、multi_accept、use、include、default_type、client_header_buffer_size、upstream...
配置了https的nginx.conf文件:修改了端口81,server_name abc.51js.net.cn; #访问的地址; ssl_certificate 1_abc.51js.net.cn_bundle.crt; #上传的CA证书; ssl_certificate_key 2_abc.51js.net.cn.key; #密钥
nginx配置文件,nginx代理配置
这是nginx安装时需要的文件之一nginx.conf
本资源是专门针对本博文的, nginx的反向代理的简单配置文件,给大家使用时做参考,拿走不谢,怎么一定要50字呢?
非常详细的 nginx.conf 配置文件详解,几乎涵盖了该配置文件能用到的所有知识点,喜欢的同学可以下载!希望对你有帮助!
本篇文章主要介绍如何借用`nginx.vim`工具来为`nginx.conf`配置文件提供语法高亮和格式化功能,使文件内容更加清晰易读。 首先,`nginx.vim`是专门为Vim设计的一个插件,它提供了针对Nginx配置文件的语法高亮支持。...
一、Nginx.conf文件结构 `nginx.conf`是Nginx的全局配置文件,通常位于安装目录的`conf`子目录下。文件结构主要包括三部分:全局块、events块和http块。 1. 全局块:这部分配置影响Nginx服务器的整体行为,如工作...
Nginx 配置文件 nginx.conf 详解 Nginx 配置文件 nginx.conf 是 Nginx 服务器的核心配置文件,它控制着 Nginx 服务器的行为和性能。在这个配置文件中,我们可以设置服务器的用户和组、工作进程数、错误日志、进程...
其中,`nginx.conf`是Nginx的核心配置文件,它决定了Nginx如何运行和处理请求。 1. **Nginx.conf结构** Nginx的配置文件通常分为全局块、events块、http块、server块和location块。全局块设置影响整个服务器,...
FastDFS配置反向代理时nginx.conf配置文件.confFastDFS配置反向代理时nginx.conf配置文件.confFastDFS配置反向代理时nginx.conf配置文件.confFastDFS配置反向代理时nginx.conf配置文件.confFastDFS配置反向代理时...
nginx-1.17.1.tar.gz以及stream模式代理oracle数据库的nginx.conf配置文件