-
-
Save mickael-kerjean/7dafd73ebaa57bea3f377fb68e531d0d to your computer and use it in GitHub Desktop.
filestash-nginx.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # cat /etc/nginx/sites-enabled/filestash.org | |
| server { | |
| listen 80; | |
| server_name mcp.filestash.app; | |
| return 301 https://$server_name$request_uri; | |
| } | |
| server { | |
| listen 443 ssl; | |
| server_name mcp.filestash.app; | |
| ssl_certificate /tmp/cert.pem; | |
| ssl_certificate_key /tmp/key.pem; | |
| location / { | |
| proxy_pass http://127.0.0.1:8334; | |
| proxy_buffering off; | |
| proxy_cache off; | |
| proxy_read_timeout 86400; | |
| proxy_set_header Host $host:$server_port; | |
| 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; | |
| } | |
| } | |
| # SETUP GUIDE: | |
| # 1) generate certs: openssl req -x509 -newkey rsa:4096 -keyout /tmp/key.pem -out /tmp/cert.pem -sha256 -days 3650 -nodes -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname" | |
| # 2) install dependencies for SSL: apt install certbot python3-certbot-nginx | |
| # 3) generate certs: sudo certbot --nginx -d mcp.filestash.app | |
| # 4) reload nginx: systemctl reload nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment