Skip to content
Mark Friedrich edited this page Jun 9, 2018 · 12 revisions

Good choice! Nginx is prefered! :)

1. Remove .htaccess files [optional]

Nginx does not support .htaccess files. -> remove them!

Hint: One advantage from Nginx over Apache is, that .htaccess don´t have to be parsed on each request. -> This lowers TTFB.


2. Server configuration

The following example configuration is used in my "Production" environment. If you need a configuration for "Local" testing/developing please contact me ;).

I run PATHFINDER in a Virtual-Host setup, based on "hp5b"´s example conf files, on Nginx v1.13.8, PHP v7.2.2, MariaDB v10.13.8 over HTTP/2.

Important: Some configuration options/values may vary between versions! Do not blind copy&paste my configuration, some options/values depend on your server hardware!

HTTP config (my nginx.conf)

In detail:

  • Set server user to nginx
  • Set worker options (depends on your hardware)
  • Set global logging options (path, format,...)
  • Set charset options
  • Set timeout options
  • Set buffer options
  • Set global file_cacheoptions
  • Enable gzip
  • Set gzip options
  • Optimize TCP settings for Single Page Apps
  • Include main server configs (e.g. sites_enabled/pathfinder.conf, see below)
Server config (my pathfinder.conf)

In detail:

  • Rewrite non www. to www.
  • Rewrite http:// to https://
  • Enable HTTP/2 protocol
  • Listen to https://www.pathfinder-w.space
  • Set ssl options for certificates
  • Include basic ssl.conf
  • Set access_log and error_log options
  • Dispatch all requests to index.php
  • Set PHP fastcgi options
  • Include basic fastcgi_params
  • Include hp5b basic.conf

Hint: Don´t forget to restart your server after config change.

If you can see the "Landingpage" with the "Login"-form on https:/www.[YOUR_DOMAIN]. You are done! :)