Mam kilka problemów z konfiguracją nginx.
Chcę dodać tag noindex dla całej strony:
Kod: Zaznacz cały
location ~* \. {
add_header X-Robots-Tag "noindex";
}
Dodatkowo nadal mogę wejść na stronę przy użyciu ip i portu bez ssl.
Kod: Zaznacz cały
server {
listen [::]:80;
listen 80;
server_name test.pl www.test.pl;
return 301 https://test.pl$request_uri;
}
server {
listen [::]:443 ssl;
listen 443 ssl;
server_name www.test.pl;
ssl_certificate /etc/letsencrypt/live/test.pl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/test.pl/privkey.pem;
return 301 https://test.pl$request_uri;
}
server {
listen [::]:443 ssl http2;
listen 443 ssl http2;
server_name test.pl;
ssl_certificate /etc/letsencrypt/live/test.pl/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/test.pl/privkey.pem;
access_log /var/log/nginx/odoo_access.log;
error_log /var/log/nginx/odoo_error.log;
proxy_read_timeout 720s;
proxy_connect_timeout 720s;
proxy_send_timeout 720s;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
location / {
proxy_pass http://127.0.0.1:8070;
}
location ~* /web/static/ {
proxy_cache_valid 200 90m;
expires 864000;
proxy_pass http://127.0.0.1:8070;
}
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
}