您的位置:首页 > 运维架构 > 反向代理

nginx 反向代理apache服务器 配置java与PHP共存环境

2014-08-03 10:21 716 查看
listen 80;

listen 443;
ssl on;
ssl_certificate /passport.crt;
ssl_certificate_key /passport.key;
ssl_session_timeout 5m;

server_name localhost;
index index.html index.htm index.php;
root /www/;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}

location ~ .(jsp|jspx|do)?$ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass locahost:8443;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: