-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathngnix.conf
51 lines (43 loc) · 1.86 KB
/
ngnix.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
#
# This file will automatically load configuration files provided by other
# applications, such as Drupal or Wordpress. These applications will be made
# available underneath a path with that package name, such as /drupal8.
#
# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
##
server {
listen 80;
listen [::]:80;
server_name blog.alfie.news;
# Redirect HTTP to HTTPS (this will be handled by Cloudflare)
return 301 https://$server_name$request_uri;
}
# Uncomment if you want to enable HTTPS
### MORE IMPORTANT IS THAT CERTBOT WILL ADD THIS
# server {
# listen 443 ssl http2;
# listen [::]:443 ssl http2;
# server_name blog.alfie.news;
# ssl_certificate /etc/letsencrypt/live/blog.alfie.news/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/blog.alfie.news/privkey.pem;
# include /etc/letsencrypt/options-ssl-nginx.conf;
# ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
# # Your site configuration
# location / {
# proxy_pass http://localhost:8080; # Assuming your C server runs on port 8080
# proxy_set_header Host $host;
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header X-Forwarded-Proto $scheme;
# }
# # Additional configurations as needed
# }