Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name xy.hu;
- return 301 https://xy.hu$request_uri;
- }
- server {
- listen 443 ssl http2;
- server_name xy.hu;
- #Security HEADERS
- add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
- add_header X-XSS-protection "1; mode=block" always;
- add_header X-Frame-Options "SAMEORIGIN" always;
- add_header X-Content-Type-Options "nosniff" always;
- add_header Feature-Policy "autoplay 'none'; camera 'none'" always;
- add_header Referrer-Policy "origin";
- #END Security HEADERS
- add_header 'Access-Control-Allow-Origin' '*' always;
- add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Origin,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type' always;
- add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, HEAD' always;
- root /home/xy/wordpress;
- index index.php;
- location / {
- try_files $uri $uri/ /index.php?$args;
- }
- location ~ \.php$ {
- if (-f $request_filename){
- fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
- }
- if (!-f $document_root$fastcgi_script_name) {
- return 404;
- }
- include snippets/fastcgi-php.conf;
- include fastcgi.conf;
- fastcgi_buffers 256 16k;
- fastcgi_buffer_size 128k;
- fastcgi_busy_buffers_size 256k;
- fastcgi_temp_file_write_size 256k;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- }
- location ~* \.(css|js|png|jpg|svg|jpeg|gif|ico)$ {
- expires 7d;
- }
- location = /xmlrpc.php {
- return 403;
- }
- location ~ /\.ht {
- deny all;
- }
- location = /robots.txt {
- root /home/xy/wordpress;
- log_not_found off;
- access_log off;
- }
- error_log /var/log/nginx/xyerror.log warn;
- gzip on;
- gzip_min_length 1000;
- gzip_buffers 16 8k;
- gzip_comp_level 9;
- gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/xhtml+xml application/xml application/xml+rss application/x-javascript;
- gzip_disable "MSIE [1-6].(?!.*SV1)";
- gzip_vary on;
- location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
- ## this rewrites sitemap.xml to /sitemap_index.xml
- rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
- ## this makes the XML sitemaps work
- rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 last;
- rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
- rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
- ## The following lines are optional for the premium extensions
- ## News SEO
- rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
- ## Local SEO
- rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
- rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
- ## Video SEO
- rewrite ^/video-sitemap.xsl$ /index.php?yoast-sitemap-xsl=video last;
- }
- ssl_certificate /etc/letsencrypt/live/xy.hu/fullchain.pem;
- ssl_certificate_key /etc/letsencrypt/live/xy.hu/privkey.pem;
- include /etc/letsencrypt/options-ssl-nginx.conf;
- ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement