Skip to content
This repository was archived by the owner on Jun 3, 2026. It is now read-only.

alpha-strike-space/NGINX-Configuration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NGINX-Configuration

This is the configuration file for nginx and any associated documentation for utilizing Cloudflare.

Notable Documentation Sources

https://nginx.org/en/docs/

https://wiki.freebsd.org/Ports/nginx

https://nginx.org/en/linux_packages.html

Important Notes:

When setting up this service, check the nginx.conf file and make sure the file paths match for everything you are serving, or any pertinent SSL certificates.

Cloudflare

Cloudflare is an amazing Domain Name Server (DNS). You may purchase or register a DNS from https://www.cloudflare.com/ and point it to your Inernet Protocol Address (IP). Generally speaking, you want the service to be proxied and strict SSL requirements set. You will get your SSL certificates generated by Cloudflare and this is typically the easiest way to handle it yourself without adding another third party service. Remember, the SSL certificaes will be in privkey.pem and fullchain.pem which is important to prevent hijacking your domain name.


BSD: FreeBSD

Note: You may not have sudo privileges on certain hosting services with BSD. It is not necessary everytime.

1. Install NGINX

sudo pkg install nginx

2. Enable NGINX Service

sudo sysrc nginx_enable="YES"

3. Start NGINX

sudo service nginx start

4. Configuration

  • Main config: /usr/local/etc/nginx/nginx.conf
  • Test config: sudo nginx -t
  • Reload after changes: sudo service nginx reload

Linux

Debian/Ubuntu

1. Install NGINX

sudo apt update
sudo apt install nginx

2. Enable & Start the Service

sudo systemctl enable nginx
sudo systemctl start nginx

3. Configuration

  • Main config: /etc/nginx/nginx.conf
  • Test config: sudo nginx -t
  • Reload after changes: sudo systemctl reload nginx

Red Hat/CentOS/Fedora

1. Install NGINX

sudo dnf install nginx    # Fedora/RHEL 8+
sudo yum install nginx    # CentOS/RHEL 7

2. Enable & Start the Service

sudo systemctl enable nginx
sudo systemctl start nginx

3. Configuration

  • Main config: /etc/nginx/nginx.conf
  • Test config: sudo nginx -t
  • Reload after changes: sudo systemctl reload nginx

Verification

Visit http://<your-server-ip>/ or https://domain.name in a browser. You should see the default NGINX welcome page or whatever you serve on index.html in your file path. Please note the difference between HTTP and HTTPS is dependent upon whether you have SSL certification from Cloudflare.

Useful Commands

  • Check status: sudo systemctl status nginx (Linux) or sudo service nginx status (FreeBSD)
  • View logs: /var/log/nginx/
  • Stop service: sudo systemctl stop nginx (Linux) or sudo service nginx stop (FreeBSD)

About

This is the configuration file for NGINX and any associated documentation for utilizing Cloudflare.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors