Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

111
Views
Serving testpage while running django on nginx

enter image description here

I'm working through https://serversforhackers.com/video/letsencrypt-for-free-easy-ssl-certificates and https://certbot.eff.org/docs/intro.html , trying to add an ssl certificate to my site (django 1.8 on nginx on ubuntu 16.04). I want to be able to serve a test page from my server. My nginx document root is at /var/www/html.

deploy@server:/var/www$ ll html/
total 40
drwxr-xr-x 3 root root  4096 Apr 26 21:17 ./
drwxr-xr-x 3 root root  4096 Apr 25 16:27 ../
drwxrwxrwx 2 root root  4096 Apr 27 11:16 .well-known/
-rw-r--r-- 1 root root 11321 Jun 21  2016 index.html
-rw-r--r-- 1 root root   612 Feb  6 16:43 index.nginx-debian.html
-rw-r--r-- 1 root root 11321 Apr 26 21:17 test.html

nginx has has 2 config files. The first is default and has the following location block:

    location ~ /.well-known {
            allow all;
    }
    location ~ /.well-known/acme-challenge/ {
            allow all;
    }

The second is:

# configuration file /etc/nginx/sites-enabled/example:
server {
    #listen 80;
    listen 80  ;
    listen [::]:80  ;
    listen 443 ssl http2  ;
    listen [::]:443 ssl http2  ;


    server_name  example.org www.example.org;
    include snippets/ssl-example.org.conf;
    include snippets/ssl-params.conf;

    location = /favicon.ico { access_log off; log_not_found off; }
    location /static/ {
        root /home/deploy/example3;
    }

    location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/run/uwsgi/example.sock;
    }

location ~* (?:^|/)\.  {
    allow all;
}

location ^~ /\.well-known {
            allow all;
    }

I want to be able to serve the test page by using:

http://example.com/test.html

Instead I get the screenshot above. How can I configure nginx or django to allow the test page to be served?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I think that the problem is not in the nginx configuration, but in the urls.py configuration. According to the screenshot, you haven't configured the url pattern r'^test.html$' that would match the URL you're trying to access.

You can find more information about configuring urls in the Django documentation.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!