provisioning tool for building opinionated architecture
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.2 KiB

10 months ago
  1. server {
  2. listen {{ env.APP_PORT }} default_server;
  3. access_log /var/log/nginx/{{ env.APP_NAME }}/wp-access.log;
  4. error_log /var/log/nginx/{{ env.APP_NAME }}/wp-error.log;
  5. client_max_body_size 50M;
  6. root /var/www/wordpress/{{ env.APP_NAME }};
  7. index index.php index.html index.htm;
  8. charset UTF-8;
  9. location / {
  10. try_files $uri/ /index.php?$args;
  11. }
  12. location ~ \.php$ {
  13. try_files $uri =404;
  14. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  15. fastcgi_pass unix:/run/php/php-fpm.sock;
  16. fastcgi_index index.php;
  17. include fastcgi.conf;
  18. }
  19. location ~* \.(js|css|png|jpg|jpeg|svg|gif|ico|eot|otf|ttf|woff|woff2|mp3|wav|ogg)$ {
  20. add_header Access-Control-Allow-Origin *;
  21. access_log off; log_not_found off; expires 30d;
  22. }
  23. # Mailpoet - tinyMCE quick fix
  24. location ~ /wp-content/plugins/wysija-newsletters/js/tinymce/.*\.(htm|html)$ {
  25. add_header Access-Control-Allow-Origin *;
  26. access_log off; log_not_found off; expires 30d;
  27. }
  28. location = /robots.txt { access_log off; log_not_found off; }
  29. location ~ /\. { deny all; access_log off; log_not_found off; }
  30. }