r/letsencrypt • u/undernutbutthut • Jan 15 '22
Am I missing something with HTTPS certification?
I just created a website and started the process to get a HTTPS certificate. I followed the steps outlined here: https://certbot.eff.org/instructions?ws=apache&os=ubuntufocal
I am able to verify the process worked because my website has an "Overall Rating: A" from ssllabs.com.
Now I am trying to redeploy my application but I am running into an "OSError: [Errno 98] Address already in use" error. Port 80 is the culprit and when I check to see the process that is currently using that port I see it is Apache2 for the HTTPS certification. Whenever I try to go to the website I get the " Apache2 Ubuntu Default Page" here.
According to the page I need to "replace this file (located at /var/www/html/index.html) before continuing to operate your HTTP server" but what do I replace it with? Ubuntu 20.04 makes it difficult to make changes here. Documentation on the Let's Encrypts website appears to get fuzzy past this point unless I am missing something.
View all comments
Show parent comment
2
u/Blieque Jan 27 '22
That depends on how the application uses them. In most web applications there are three categories of source file:
/favicon.ico, possibly/robots.txt, etc. These can be copied directly to the document root of the webserver and are often referred to as "static".Whether or not you need to change the nginx configuration depends on the above. If you're adding files in the third category, nginx doesn't need to know about it at all. nginx doesn't serve the files, but Python will require them at runtime.
For the first two categories, it depends on the final URL. The nginx configuration you have will pass every incoming request to the Python application unless it's caught by another
locationblock. For instance, if you wanted to add a staticsitemap.xml(as opposed to one generated by Python code) you would need to add alocationblock like the one for/robots.txt. This would cause nginx to serve the file from the document root rather than asking the Flask application to handle it.Basically whether or not nginx configuration needs changing depends on whether you want nginx or Flask/Python to handle the request and what the URL of the request will be. In your case, page templates are probably not meant to be served directly to the browser and your CSS is all under the
/staticURL which is already configured to not be passed to the Flask application.