Coder Social home page Coder Social logo

nicholasgriffintn / nginx-conf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nomadturk/nginx-conf

0.0 2.0 0.0 427 KB

Nginx Configuration template for all. This is my nginx conf that I tried to compile for use with any kind of site. Can be improved. It is configured to run with php-fpm, pagespeed and else.

Nginx 50.76% Shell 4.28% DIGITAL Command Language 44.96%

nginx-conf's Introduction

nginx-conf

General purpose Nginx Configuration Template

Nginx Template

Here lies my personal Nginx template for a mixed setup. I'm trying to make this nginx configured for general use; whether it's wordpress or static html or whatever. My aim is to enable caching, SEO friendly URL's, Cloudflare support, adding h5bp, ngx_pagespeed optimizations etc. Thus trying to create a copy/paste style nginx template.

It also uses https://github.com/h5bp/server-configs-nginx and a compilation of many tweaks.

Requirements

Nginx 1.6 and above. nginx-extras or your own compilation with the following:

  • ngx_pagespeed (comes with nginx extras)
  • ngx_http_gunzip

What to do?

  • Edit pagespeed settings: Edit pagespeed to add/remove filters.

  • Add your domains to pagespeed.conf

  • Create cache and log folders

  • Change ownership of the folders. You can run the below bash script to create and chmod all these folders.

for dir in /var/cache/nginx/  /var/cache/nginx/client /var/cache/nginx/scgi /var/cache/nginx/uwsgi /var/cache/nginx/fastcgi /var/cache/nginx/proxy /var/ngx_pagespeed_cache /var/log/nginx /var/log/pagespeed /var/ngx_pagespeed_cache /var/log/pagespeed
do
if [ ! -d $dir ]; then
	mkdir -p $dir
	chown -R  www-data:www-data $dir
else
	chown -R  www-data:www-data $dir
fi
done

Known Issues

nginx-conf's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.