server { listen 80; server_name morsoft.alafricaine.net; root /var/www/centre-sante-app/public; index index.php index.html; # Redirect all HTTP to HTTPS (Certbot can also do this) location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } error_page 404 /index.php; location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php-fpm.sock; # adjust socket or host:port fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location ~ /\.ht { deny all; } # Static files cache location ~* \.(jpg|jpeg|png|gif|css|js|ico|svg)$ { expires 30d; access_log off; } access_log /var/log/nginx/morsoft_access.log; error_log /var/log/nginx/morsoft_error.log; } # Optional: add a server block for HTTPS after obtaining certs with Certbot.