• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

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