首页 文章

nginx作为运行apache的反向代理

提问于
浏览
2

我在配置 nginx 作为反向代理时遇到了一些麻烦 .

很高兴我说我的VPS安装了 kloxowebmin 并在我的VPS上运行多个域 .

我通过 REPELYUM 安装了 nginx ,这是我在link中给出的 /etc/nginx/nginx.conf 文件 .

我将apache端口更改为8080并重新启动服务以进行更改并启动nginx并且存在一些问题 .

当我尝试访问我的centos vps上的每个域时,我面对 APACHE START PAGE (WELCOME PAGE) ,当我在浏览器中输入我的VPS IP时,如 x.x.x.x ,我面对 NGINX START PAGE (WELCOME PAGE) .

我希望 nginx 能够提供我的静态文件并将动态文件重定向到 Apache 以获得更好的性能 .

1 回答

  • 0

    Nginx Http Server,第235页有一个例子 .

    server {
        server_name .example.com;
        root /home/example.com/www;
        location ~* \.php.$ {
            # Proxy all requests with an URI ending with .php*
            # (includes PHP, PHP3, PHP4, PHP5...)
            proxy_pass http://127.0.0.1:8080;
        }
        location / {
            # Your other options here for static content
            # for example cache control, alias...
            expires 30d;
        }
    }
    

相关问题