https://github.com/laozhu/nginx-configs
👨💻 My personal server's nginx configs, optimized for HTTPS and HTTP2
https://github.com/laozhu/nginx-configs
http2 https letsencrypt nginx nginx-configuration
Last synced: 9 days ago
JSON representation
👨💻 My personal server's nginx configs, optimized for HTTPS and HTTP2
- Host: GitHub
- URL: https://github.com/laozhu/nginx-configs
- Owner: laozhu
- Created: 2017-07-25T05:25:44.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-05-15T15:48:45.000Z (about 7 years ago)
- Last Synced: 2025-01-16T11:26:43.233Z (over 1 year ago)
- Topics: http2, https, letsencrypt, nginx, nginx-configuration
- Homepage: https://github.com/laozhu/nginx-configs
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nginx Configs 
_My personal server's nginx configs, optimized for HTTPS and HTTP2_
## Install
```bash
sudo apt install nginx
sudo apt install certbot python-certbot-nginx
sudo certbot --nginx certonly
```
Then copy nginx configs to your server's `/etc/nginx` folder
```bash
ln -s /etc/nginx/sites-available/example.com.conf /etc/nginx/sites-enabled/example.com.conf
```
Change the `server_name: example.com` and `root /home/ritchie/www/example.com` of server to yours.
## Test
```bash
sudo nginx -t
sudo nginx reload
```
Test and change your configs until it's OK ✅.
## Renew
If certificate is getting expired in next 30 days, certbot will renew certificates automatically.
## Credits
- [Let’s Encrypt](https://letsencrypt.org/)
- [Certbot](https://certbot.eff.org/)
- [server-configs-nginx](https://github.com/h5bp/server-configs-nginx)
- [SSL Server Test](https://www.ssllabs.com/ssltest/)
- [HTTP Security Report](https://httpsecurityreport.com)
- [Mozilla SSL Configuration Generator](https://mozilla.github.io/server-side-tls/ssl-config-generator/)
- [CSP Evaluator](https://csp-evaluator.withgoogle.com/)
- [CSP Generator](https://report-uri.com/home/generate/)
- [内容安全策略](https://developers.google.com/web/fundamentals/security/csp/?hl=zh-cn)