Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8787747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:58:02+00:00 2026-06-13T21:58:02+00:00

I’ve migrated my server to amazon ec2, and trying to set up the following

  • 0

I’ve migrated my server to amazon ec2, and trying to set up the following environment there:

Nginx in the front serving static content, passing to django for dynamic content. I also would like to use phpmyadmin in this setting.

I am not a server admin, so I simply followed a few tutorials to make nginx and django up and running. But I’ve been working for two days now trying to hook phpmyadmin to this setup, with no avail. I am sending my current server configuration now, how can I serve phpmyadmin here?

server {
    listen   80;
    server_name localhost;

    access_log /opt/django/logs/nginx/vc_access.log;
    error_log  /opt/django/logs/nginx/vc_error.log;

    # no security problem here, since / is always passed to upstream
    root /opt/django/;
    # serve directly - analogous for static/staticfiles
    location /media/ {
        # if asset versioning is used
        if ($query_string) {
            expires max;
        }
    }
    location /admin/media/ {
        # this changes depending on your python version
        root /path/to/test/lib/python2.7/site-packages/django/contrib;
    }
    location /static/ {
        # if asset versioning is used
        if ($query_string) {
            expires max;
        }
    }
    location / {
        proxy_pass_header Server;
        proxy_set_header Host $http_host;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_connect_timeout 10;
        proxy_read_timeout 10;
        proxy_pass http://localhost:8000/;
    }
    # what to serve if upstream is not available or crashes
    error_page 500 502 503 504 /media/50x.html;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T21:58:04+00:00Added an answer on June 13, 2026 at 9:58 pm

    This question should rightly belong to http://serverfault.com

    Nevertheless, the first thing you ought to do is to configure a separate subdomain for your phpmyadmin for ease of administration.

    So there will be two apps running with nginx as reverse proxy, one nginx server for your above django app and another server (also known as virtualhost) for your phpmyadmin with a configuration similar to this:-

    server {
             server_name     phpmyadmin.<domain.tld>;
             access_log      /srv/http/<domain>/logs/phpmyadmin.access.log;
             error_log       /srv/http/<domain.tld>/logs/phpmyadmin.error.log;
    
             location / {
                     root    /srv/http/<domain.tld>/public_html/phpmyadmin;
                     index   index.html index.htm index.php;
             }
    
             location ~ \.php$ {
                     root            /srv/http/<domain.tld>/public_html/phpmyadmin;
                     fastcgi_pass    unix:/var/run/php-fpm/php-fpm.sock;
                     fastcgi_index   index.php;
                     fastcgi_param   SCRIPT_FILENAME  /srv/http/<domain.tld>/public_html/phpmyadmin/$fastcgi_script_name;
                     include         fastcgi_params;
             }
     }
    

    Each of your server configuration can point at different domain names via the server_name configuration. In this example, server_name phpmyadmin.<domain.tld>;

    Here’s an example taken from http://wiki.nginx.org/ServerBlockExample

    http {
      index index.html;
    
      server {
        server_name www.domain1.com;
        access_log logs/domain1.access.log main;
    
        root /var/www/domain1.com/htdocs;
      }
    
      server {
        server_name www.domain2.com;
        access_log  logs/domain2.access.log main;
    
        root /var/www/domain2.com/htdocs;
      }
    }
    

    As you can see, there are two declarations of server inside the large http brackets. Each declaration of the server should contain the configuration you have for django and another for the configuration of phpmyadmin.

    2 “virtual hosts” (“server” instances) taken care by nginx.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I know there's a lot of other questions out there that deal with this
I'm trying to select an H1 element which is the second-child in its group
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.