Skip to content

Instantly share code, notes, and snippets.

@ozzpy
Last active January 17, 2023 18:21
Show Gist options
  • Save ozzpy/54888c7c481614e1b6fc12e8c0f5a6da to your computer and use it in GitHub Desktop.
Save ozzpy/54888c7c481614e1b6fc12e8c0f5a6da to your computer and use it in GitHub Desktop.
Ubuntu 18.04 - nginx1.4 - php7.2 : wordpress
server {
listen 80;
listen [::]:80;
root /var/www/html;
index index.php index.html index.htm;
server_name example.com www.example.com;
client_max_body_size 500M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
@ozzpy
Copy link
Author

ozzpy commented Jan 17, 2023

add header to prevent http request fail in admin pages add_header 'Content-Security-Policy' 'upgrade-insecure-requests'; below client_max_body_size

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment