Set up certbot with nginx built with ngx_pagespeed


#1

Hello, I’m getting frustrated over this so I came here to ask,

I installed nginx on my 16.04 Ubuntu server following the instruction from : https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source to have it with the ngnx_pagespeed plugin built in. As i add certbot to my server and try and obtain certificates it changes something in the conf file of nginx and i dont get the same of before.

The automatic installation from pagespeed install nginx in /usr/local/nginx/sbin/nginx and the conf file is located in /usr/local/nginx/conf/nginx.conf but when i download certbot and run

sudo certbot certonly --standalone -d awwwards.loudsrl.com

It creates other .conf files (maybe other nginx also)

My question is, is it possible to have certbot support with my configuration?

My domain is: awwwards.loudsrl.com

My web server is (include version): nginx 1.13.10

The operating system my web server runs on is (include version): Ubuntu 16.04

I can login to a root shell on my machine (yes or no, or I don’t know): yes


#2

If you use standalone, it will not touch your nginx configuration at all, instead it will launch an internal webserver to authorize for your domain.


#3

I installed with
sudo apt-get install python-certbot-nginx
could that have been the error?


#4

Also if i try doing
nginx -v
it says nginx/1.10.3 (Ubuntu)
but if i do
/usr/local/nginx/sbin/nginx -v
which is my nginx it says
nginx/1.13.10
So i think i have two nginx now


#5

yup.

What I did when I build my pagespeed Nginx from core is that I use all arguments from original Nginx and just replaced that Nginx. (What you are using is creating two Nginx instances)


#6

And how would i do that? Install nginx first and the add the ngx_pagespeed module? Or install nginx the automated way and then add certbot only?


#7

Now you can try using yum to remove the nginx (installed via yum) and proceed with certbot.

Also, you might need to change the nginx (startup file) from systemctl or whatever you use (to your new install)

Thank you


#8

So I will try to remove the yum intalled nginx and change the /lib/systemd/system/nginx.service, and then try to do again the certbot ?


#9

Yep.
You might also need to specify Nginx path (not necessarily if certbot found the path)


#10

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.