Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2021
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name xy.hu;
  4. return 301 https://xy.hu$request_uri;
  5.  
  6.  
  7. }
  8.  
  9. server {
  10.  
  11. listen 443 ssl http2;
  12. server_name xy.hu;
  13. #Security HEADERS
  14.  
  15. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  16. add_header X-XSS-protection "1; mode=block" always;
  17. add_header X-Frame-Options "SAMEORIGIN" always;
  18. add_header X-Content-Type-Options "nosniff" always;
  19. add_header Feature-Policy "autoplay 'none'; camera 'none'" always;
  20. add_header Referrer-Policy "origin";
  21. #END Security HEADERS
  22. add_header 'Access-Control-Allow-Origin' '*' always;
  23. 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;
  24. add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, HEAD' always;
  25.  
  26.  
  27.  
  28. root /home/xy/wordpress;
  29.  
  30. index index.php;
  31.  
  32. location / {
  33.  
  34. try_files $uri $uri/ /index.php?$args;
  35.  
  36. }
  37.  
  38. location ~ \.php$ {
  39. if (-f $request_filename){
  40. fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
  41. }
  42. if (!-f $document_root$fastcgi_script_name) {
  43. return 404;
  44. }
  45. include snippets/fastcgi-php.conf;
  46. include fastcgi.conf;
  47. fastcgi_buffers 256 16k;
  48. fastcgi_buffer_size 128k;
  49. fastcgi_busy_buffers_size 256k;
  50. fastcgi_temp_file_write_size 256k;
  51. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  52. }
  53.  
  54.  
  55.  
  56. location ~* \.(css|js|png|jpg|svg|jpeg|gif|ico)$ {
  57. expires 7d;
  58. }
  59.  
  60. location = /xmlrpc.php {
  61. return 403;
  62. }
  63.  
  64. location ~ /\.ht {
  65. deny all;
  66. }
  67.  
  68. location = /robots.txt {
  69. root /home/xy/wordpress;
  70. log_not_found off;
  71. access_log off;
  72. }
  73. error_log /var/log/nginx/xyerror.log warn;
  74.  
  75.  
  76. gzip on;
  77. gzip_min_length 1000;
  78. gzip_buffers 16 8k;
  79. gzip_comp_level 9;
  80. 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;
  81. gzip_disable "MSIE [1-6].(?!.*SV1)";
  82. gzip_vary on;
  83.  
  84. location ~ ([^/]*)sitemap(.*).x(m|s)l$ {
  85. ## this rewrites sitemap.xml to /sitemap_index.xml
  86. rewrite ^/sitemap.xml$ /sitemap_index.xml permanent;
  87. ## this makes the XML sitemaps work
  88. rewrite ^/([a-z]+)?-?sitemap.xsl$ /index.php?yoast-sitemap-xsl=$1 last;
  89. rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
  90. rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
  91. ## The following lines are optional for the premium extensions
  92. ## News SEO
  93. rewrite ^/news-sitemap.xml$ /index.php?sitemap=wpseo_news last;
  94. ## Local SEO
  95. rewrite ^/locations.kml$ /index.php?sitemap=wpseo_local_kml last;
  96. rewrite ^/geo-sitemap.xml$ /index.php?sitemap=wpseo_local last;
  97. ## Video SEO
  98. rewrite ^/video-sitemap.xsl$ /index.php?yoast-sitemap-xsl=video last;
  99. }
  100.  
  101.  
  102. ssl_certificate /etc/letsencrypt/live/xy.hu/fullchain.pem;
  103. ssl_certificate_key /etc/letsencrypt/live/xy.hu/privkey.pem;
  104. include /etc/letsencrypt/options-ssl-nginx.conf;
  105. ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement