Welcome to WordPress. This is your first post. Edit or delete it, then start writing!
print("hello, world")
server {
listen 80;
server_name example.com www.example.com;
root /var/www/wordpress;
index index.php;
# WordPress permalinks
location / {
try_files $uri $uri/ /index.php?$args;
}
# PHP handling
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php-fpm.sock;
}
}
map $http_accept $webp_path {
default "";
"~*webp" "/webp/$uri.webp";
}
server {
listen 80;
listen [::]:80;
root /var/www/wordpress;
index index.php;
server_name example.com www.example.com;
client_max_body_size 100M;
set $skip_cache 0;
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
set $skip_cache 1;
}
if ($request_uri ~* "/wp-admin|/xmlrpc.php|/wp-login.php|/wp-..php|ˆ/feed/|/tag/./feed/|/.sitemap..(xml|xsl)") {
set $skip_cache 1;
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $skip_cache 1;
}
if ($http_user_agent ~* "wp-rocket") {
set $skip_cache 1;
}
location ~* ^/wp-includes/.*\.php$ {
deny all;
}
set $block_admin 0;
if ($request_uri ~ ^/wp-admin/) {
set $block_admin 1;
}
if ($request_uri ~ ^/wp-admin/admin-ajax.php) {
set $block_admin 0;
}
if ($uri ~* \.(js|css|svg)$) {
set $block_admin 0;
}
if ($http_cookie !~* "wordpress_logged_in_") {
set $block_admin 1$block_admin;
}
if ($block_admin = 11) {
return 302 /wp-login.php?redirect_to=$request_uri;
}
location ~* /(config|private|backup|secrets)/ {
deny all;
return 403;
}
location ~ \.(env|py|aspx|jsp)$ {
deny all;
return 403;
}
location ~ \.(webp|css|js|svg|ttf|json|html|htm|txt)$ {
add_header cache-control "public, max-age=31536000";
try_files $uri $uri/ =404;
}
location ~ \.(gif|jpg|jpeg|png)$ {
add_header cache-control "public, max-age=31536000";
try_files $webp_path $uri =404;
}
location ~* ^/wp-includes/blocks/(index.php)?$ {
if ($http_user_agent ~* "bot") {
return 403;
}
}
location = /wp-comments-post.php {
deny all;
}
location = /xmlrpc.php {
deny all;
}
location = /wp-config.php {
deny all;
}
location = /wp-config-sample.php {
deny all;
}
location = /wp-cron.php {
deny all;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.3-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 300s;
fastcgi_buffer_size 128k;
fastcgi_buffers 8 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_cache WORDPRESS;
fastcgi_cache_valid 200 301 302 10m;
fastcgi_cache_use_stale error timeout updating invalid_header http_500 http_503;
fastcgi_cache_min_uses 1;
fastcgi_cache_lock on;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
add_header X-FastCGI-Cache $upstream_cache_status;
}
}