diff --git a/block.sh b/block.sh new file mode 100644 index 0000000..febc8da --- /dev/null +++ b/block.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +echo "server { + root /var/www/html/wp; + index index.php index.html index.htm; + server_name frontend.floss.my.id; + server_tokens off; + access_log /var/log/nginx/frontend_access.log; + error_log /var/log/nginx/frontend_error.log; + gzip on; + gzip_vary on; + gzip_min_length 10240; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml application/javascript text/x-javascript; + gzip_disable "MSIE [1-6]\."; + + + location / { + try_files $uri $uri/ /index.php?$args; + proxy_headers_hash_max_size 512; + proxy_headers_hash_bucket_size 64; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + add_header Front-End-Https on; + } + + location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ { + expires 365d; + } + + location ~* \.(pdf)$ { + expires 30d; + } + location ~ \.php$ { + fastcgi_pass 127.0.0.1:9000; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + }" > blocks.conf