【发布时间】:2017-04-25 09:23:16
【问题描述】:
我有问题;-)
我们有:
Apache2 -> ProxyPass -> intern.domain.foo/ -> Ngnix -> PHP
问题是静态文件,如 CSS/图像 ....
我们得到:
https://foo.example.com/foobar/images/bla.png
代替:
https://foo.example.com/foobar/iframes/images/bla.png
在我们的 Apache2.2 中我们使用:
...
# ProxyPass to Appint Iframes
ProxyPass /iframes http://intern.domain.foo
<Location /iframes>
ProxyPassReverse http://intern.domain.foo
</Location>
....
在 Nginx 上:
server {
listen *:80;
server_name intern.domain.foo;
root /opt/webapps/iframes/web/;
index index.php;
location / {
root /opt/webapps/iframes/web/;
index index.html index.htm index.php;
try_files $uri /app.php$is_args$args;
}
location ~ ^/app\.php(/|$) {
root /opt/webapps/iframes/web/;
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_connect_timeout 3m;
fastcgi_param DOCUMENT_ROOT $realpath_root;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_read_timeout 3m;
fastcgi_send_timeout 3m;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
internal;
}
}
Symfony 应用程序不知道它是通过 Apache ProxyPass 包含的,所以我的问题是,我必须在哪里更改配置。在 Apache2 或 Nginx 或 Symfony 上? :-)
非常感谢 :-) 库丹尼
【问题讨论】:
标签: nginx reverse-proxy apache2.2 symfony-3.2