Skip to content

Instantly share code, notes, and snippets.

@darksinge
Created January 24, 2020 20:44
Show Gist options
  • Save darksinge/1130398e6974dd1186c4cb4c2e9e506e to your computer and use it in GitHub Desktop.
Save darksinge/1130398e6974dd1186c4cb4c2e9e506e to your computer and use it in GitHub Desktop.
NGINX Config Example
# /etc/nginx/nginx.conf
http {
...
include /etc/nginx/sites-available/*.conf # Include all config files that end in .conf
...
}
# /etc/nginx/sites-available/example.com.conf
server {
listen 80 default_server;
listen 443 ssl;
server_name example.com www.example.com
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem
root /var/www/html;
if ($request_method = OPTIONS) {
return 204;
}
location / {
add_header Access-Control-Allow-Origin $http_origin;
proxy_pass http://localhost:8080
}
location /static {
try_files $uri $uri/ =404;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment