Git Product home page Git Product logo

simplenginx's Introduction

SimpleNginx

A simple Nginx instance powered by Docker

Setup Instructions

Execute the following commands:

# This command will generate ./config/dhparams.pem (To enable SSL) (NOTE: This takes a while)
./gen-dhparams.sh 
# This command will generate ./certs/privkey.pem and ./certs/fullchain.pem (To enable SSL)
./gen-certs.sh

Start/Stop Instructions

Commands:

  • Start: docker compose up -d
  • Stop: docker compose down

Recommendations

Since Nginx hosts are typically exposed to the internet, its best to set up a firewall and only enable the ports that is needed:

  • 80 (http)
  • 443 (https)
  • Stream Ports (The ports that are used in the *.conf files under the stream-available/ folder

How to set it up using ufw (typically used in Ubuntu hosts)

# Check if ufw is enabled or not
bash$ sudo ufw status 
# If ufw isn't enabled, then enable it
bash$ sudo ufw enable
# Check again to make sure that ufw is enabled 
bash$ sudo ufw status

# Example: Enable HTTP(S) ports
bash$ sudo ufw allow 80
bash$ sudo ufw allow 443

# Example: Check what the what ports ufw is denying/allowing/disabling
bash$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip

To                         Action      From
--                         ------      ----
80                         ALLOW IN    Anywhere                  
443                        ALLOW IN    Anywhere                  
80 (v6)                    ALLOW IN    Anywhere (v6)             
443 (v6)                   ALLOW IN    Anywhere (v6)             

# Example: Remove allowed ports (suppose you don't want to allow the http port)
bash$ sudo ufw delete allow 80

simplenginx's People

Contributors

thehenrylam avatar

Watchers

 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.