Skip to content

Set of Nginx configuration templates to simplify the creation of virtual hosts

Notifications You must be signed in to change notification settings

bjornpost/nginx_config_templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nginx Rewrites

Overview

This project contains a set of nginx configuration templates which simplify the creation of virtual hosts. The templates in the repository are considered stable, and are tested.

Templates

  • server.error.conf: custom error HTML templates
  • server.favicon.conf: serve the favicon.ico. If none is found, serve an empty gif.
  • server.gzip.conf: Gzip compression settings for css/js/xml/json/rss files.
  • server.listen-local-only: shortcut for listen 8080. Comes in handy if you're using Varnish.
  • server.location.deny.conf: Restricts access to .git, .hg, .ht* files and directories.
  • server.logging.conf: Set logging for a virtual host.
  • server.php5.conf: Enable PHP5 for host.
  • server.rewrites.cakephp.conf: Rewrites for CakePHP projects.
  • server.rewrites.django.conf: Rewrites for Django projects.
  • server.rewrites.symphony2.conf: Rewrites for Symphony 2 projects.
  • server.rewrites.wordpress.conf: Rewrites for Wordpress projects.

How to use

I have prepared some virtual hosts as an example in the examples/ directory. You can use this as a starting point for your own virtual hosts. It mostly comes down to including the right template:

server {
	server_name wordpress.example.com;
	root /home/example-com/htdocs/wordpress;
	index index.php index.html;

	include templates/server.rewrites.wordpress.conf;
	include templates/server.listen-local-only.conf;
	include templates/server.php5.conf;
	include templates/server.gzip.conf;
	include error.conf;
}

About

Set of Nginx configuration templates to simplify the creation of virtual hosts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published