全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
查看: 991|回复: 2
打印 上一主题 下一主题

nginx反向代理目录跳转类的问题,应该注意哪些配置?

[复制链接]
跳转到指定楼层
1#
发表于 2012-3-1 02:19:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
具体的错误我也说不清楚,就是目录跳转,我用CLOUDFLARE 那个 就正常,我自己nginx 配置的就出现403或302错误!
听说CLOUDFLARE 也是nginx 的!大神指点下了,是不是我初始配置没搞对?

以下是配置文件!

#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    gzip on;

    gzip_min_length  1k;

    gzip_buffers     4 16k;

    gzip_http_version 1.1;

    gzip_comp_level 3;

    gzip_types       text/plain application/x-javascript text/css text/xml  application/atom+xml application/rss+xml text/vnd.wap.wml text/x-component application/octet-stream application/x-rar-compressed;

    gzip_vary on;

    #proxy_temp_path   temp/proxy_temp_dir;
    #proxy_cache_path  temp/proxy_cache_dir levels=1:2 keys_zone=cache_one:200m inactive=1d max_size=30g;

    server {
        listen       8088;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {

            sub_filter  http://www;

            sub_filter_once off;
            #proxy_redirect / '';

            proxy_set_header referer $http_referer;
proxy_set_header Accept-Encoding '';
            #proxy_set_header X-Forwarded-For  $remote_addr;
            #proxy_cache cache_one;
            #proxy_cache_valid  200 304 12h;
            #proxy_cache_key $host$uri$is_args$args;
            proxy_pass http://www;
            expires     1d;
        }








    }






}
suzizi 该用户已被删除
推荐
发表于 2012-3-1 10:08:58 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
3#
发表于 2012-3-1 10:21:13 来自手机 | 只看该作者
不懂耶
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2026-4-15 12:46 , Processed in 0.118051 second(s), 14 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表