Last active
January 17, 2023 18:21
-
-
Save ozzpy/54888c7c481614e1b6fc12e8c0f5a6da to your computer and use it in GitHub Desktop.
Ubuntu 18.04 - nginx1.4 - php7.2 : wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add header to prevent http request fail in admin pages
add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
below client_max_body_size