• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question What is the proper nginx additional directives with wordpress

Walter

Basic Pleskian
Here are my additional nginx directives for my websites. It includes caching, compressing, enabling OCSP with Let's Encrypt and certain headers for security. My question is in regards to the settings required for Wordpress to work correctly. The particular setting is:

Code:
#Necessary to enable php fpm for nginx
if (!-e $request_filename) {
    rewrite ^.*$ /index.php last;
}

Is the setting above the best way to enable Wordpress with an nginx only and php fpm for nginx 7.1 configuration?
If not, how should I do this?


Code:
#Cache certain web stuff
location ~* \.(png|jpg|ico|js|css|jpeg|gif|woff|woff2|svg)$ {
    expires 8d;
    add_header Pragma public;
    add_header Cache-Control public;
    access_log off;
}
#Gzip site
gzip on;
gzip_disable msie6;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 2;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon text/x-component application/javascript application/rss+xml font/truetype;

#Necessary to enable php fpm for nginx
if (!-e $request_filename) {
    rewrite ^.*$ /index.php last;
}

#Enable OCSP
ssl_stapling on;
ssl_stapling_verify on;
#ssl_trusted_certificate /usr/local/psa/var/modules/letsencrypt/etc/live/yourdomain.tld/chain.pem;
resolver 8.8.4.4 8.8.8.8 valid=300s;
resolver_timeout 10s;

#Header Security Additions
server_tokens off;
proxy_hide_header X-Powered-By;
add_header Referrer-Policy no-referrer-when-downgrade;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";

add_header Content-Security-Policy "default-src 'none'; script-src 'self' https://www.google-analytics.com/; style-src 'self' https://fonts.googleapis.com; img-src 'self' https://www.google-analytics.com; font-src 'self' https://fonts.googleapis.com https://fonts.gstatic.com; frame-src 'self'; frame-ancestors 'none'; form-action 'none'; upgrade-insecure-requests; block-all-mixed-content; reflected-xss block; base-uri $host www.$host; referrer no-referrer-when-downgrade";

I guess it should be stated that all of this does work well but just want to be sure that the WordPress piece is configured optimally...
 
Last edited:
Back
Top