SSL on Nginx
-
I followed the guide:
http://vpsbible.com/security/ssl-nginx/However, I'm facing some issues. I guess I still made a mess out of something. Getting following error when I try to restart Nginx:
Starting nginx: [emerg]: unknown directive "ssl" in /usr/local/nginx/sites-enabled/domain.com:30
I installed Nginx using the stackscript here. Is ssl not installed?
Posted 1 year ago # -
I did following last step:
cd /usr/local/nginx/conf
openssl genrsa -des3 -out server.key 1024
# .. follow prompts
openssl req -new -key server.key -out server.csr
# .. follow prompts
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
# .. follow prompts
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crtwithout changing the "server.crt", "server.key" etc. Should this be changed to "mydomain.com.crt" etc?
Posted 1 year ago # -
The /usr/local/nginx/sites-available/mydomain.com file seems to cause the error:
server {
listen 80;
server_name http://www.mydomain.nu;
rewrite ^/(.*) http://mydomain.nu/$1 permanent;
}server {
listen 80;
server_name mydomain.com;
access_log /home/hkim/public_html/mydomain.com/log/access.log;
error_log /home/hkim/public_html/mydomain.com/log/error.log;
location / {
root /home/hkim/public_html/mydomain.com/public/;
index index.php index.html;
include /usr/local/nginx/conf/wordpress_params.super_cache;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /home/hkim/public_html/mydomain/public/$fastcgi_script_name;
}
}server {
listen 80;
server_name http://www.mydomain.com mydomain.com;
rewrite ^/(.*) https://www.mydomain.com/$1 permanent;
}server {
listen 443;
server_name http://www.mydomain.com;
ssl on;
ssl_certificate /usr/local/nginx/conf/server.crt;
ssl_certificate_key /usr/local/nginx/conf/server.key;
# ... add more non-essential SSL directives *
# ... add regular config until the closing bracket }Posted 1 year ago # -
I used the: http://vpsbible.com/vps-setup-guides/stackscripts/lemp-stack-lite-ubuntu-32bit-php-fpm/ to install LEMP. It seems that nginx in that stackscript is compiled with the required ssl module?
Posted 1 year ago # -
Ok. Downloaded and recompiled with ssl module.
Posted 1 year ago # -
I have now installed ssl. However, when I go to: https://mysite.com, I am directed to Nginx standard greeting page instead of the wordpress installation I have. What is wrong now?
Posted 1 year ago # -
So stupid. Corrected the /usr/local/nginx/site-available/mydomain.com file. Just moved the path definitions from
Server {
listen 80;
[...]to beneath
Server {
listen 443;
[...]Posted 1 year ago # -
LOL! (sorry .. tis an easy mishtake).
@all .. read twice, do once!!!
Posted 1 year ago # -
If you add delete function to the forum, I could have erased remaining evidence of my studpidity... ;)
Posted 1 year ago #
Reply
You must log in to post.
Want HTML?
a blockquote code em strong ul ol liPlace code between backticks `codeHere`
You've got it.
