Created
October 20, 2012 09:06
-
-
Save ymek/3922731 to your computer and use it in GitHub Desktop.
Create self-signed certificate for nginx
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
| # cd /etc/nginx/ | |
| # openssl genrsa -des3 -out server.key 1024 | |
| # openssl req -new -key server.key -out server.csr | |
| # cp server.key server.key.org | |
| # openssl rsa -in server.key.org -out server.key | |
| # openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | |
| # Example /etc/nginx/sites-available/my_project.conf | |
| server { | |
| listen 443; | |
| server_name _; | |
| ssl on; | |
| ssl_certificate /etc/nginx/server.crt; | |
| ssl_certificate_key /etc/nginx/server.key; | |
| access_log /var/log/nginx/my_project_access.log; | |
| error_log /var/log/nginx/my_project_error.log debug; | |
| root /var/www/my_project/current/public; | |
| passenger_enabled on; | |
| #location / { | |
| #} | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment