I have a Plone4 and Nginx working on the same server (CentOS6). Nginx is working fast but all links on the Plone site received a target="_blank" attribute. All the links are opening in a new window when using Nginx. I open the same Plone site using the Zope webserver or via apache and the problem disapear. I tried different configurations but I cannot get the correct links. How can I solve this?
My current Nginx configuration is:
add_header X-Frame-Options "SAMEORIGIN";
add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
#add_header Content-Security-Policy "default-src 'self'; img-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'";
add_header Content-Security-Policy-Report-Only "default-src 'self'; img-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'";
upstream plone {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name mywebsite.com;
rewrite ^/(.*) http://www.mywebsite.com/$1 permanent;
}
server {
listen 80;
server_name www.mywebsite.com;
access_log /var/log/nginx/mywebsite.com.access.log;
error_log /var/log/nginx/mywebsite.com.error.log;
location / {
#proxy_pass http://plone/VirtualHostBase/http/mywebsite.com:80/mywebsite/VirtualHostRoot/;
rewrite ^/(.*)$ /VirtualHostBase/http/mywebsite.com:80/mywebsite/VirtualHostRoot/$1 break;
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}