Please note that this configuration is a starting point, and you may need to adjust it to suit your specific Nginx and PHP-FPM setup. Also, remember to include this configuration within your Nginx server block, which is typically found in the /etc/nginx/sites-available/ directory.
# NEXT LINE IS REQUIRED FOR SETUP - change this to index.php after setup is complete
index setup.php;
# SEO settings
location / {
try_files $uri $uri/ @htmlext;
}
location @htmlext {
rewrite ^/(.*)$ /index.php?include=$1 last;
}
location ~ ^/welcome/([^/]+)$ {
rewrite ^ /index.php?signup=1 last;
}
location ~ ^/users/([^/]+)$ {
rewrite ^ /index.php?user=$1 last;
}
location ~ ^/users([^/]+)$ {
rewrite ^ /index.php?user=$1 last;
}
error_page 404 /content/errors/404.html;
# CACHE + THREAD SETTINGS
gzip on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_types
application/x-javascript
application/javascript
application/vnd.ms-fontobject
application/x-font-ttf
application/x-font-opentype
application/x-font-woff
image/svg+xml
text/css
text/html
text/javascript
text/plain;
# Cache settings
location ~* .(ico|css|js|gif|jpe?g|png|pdf|avi|mov|ppt|doc|mp3|wmv|wav|swf)$ {
expires 14d;
add_header Cache-Control "public";
}
location ~* .(xml|txt|htm|html)$ {
expires 1d;
add_header Cache-Control "private, must-revalidate";
}
location ~* .(php|cgi|pl)$ {
expires -1;
add_header Cache-Control "no-store, no-cache, must-revalidate, max-age=0";
add_header Pragma "no-cache";
}
# Add correct content-type for fonts
types {
application/vnd.ms-fontobject eot;
application/x-font-ttf ttf;
application/x-font-opentype otf;
application/x-font-woff woff;
image/svg+xml svg;
}
# PHP location block
# Adjust this to match your PHP-FPM settings
location ~ .php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
To set up YaWK using Nginx, follow these steps:
Prerequisites:
Ensure that you have Nginx, PHP, and PHP-FPM installed on your server.
If you don't have them installed, you can follow these guides:
Installation Instructions:
To set up your application using Apache, follow these steps:
Installation Instructions: