0

In my public folder, I have

$ ls public
index.php   mGSV

and

$ ls public/mGSV/
ARCHITECTURE.txt    Install         base_mgsv.php       history.php     index.php       mgsv.php        scripts         tmp
Arial.ttf       README          contact.php     html            js          sample_annotation.txt   software.php        tutorial.php
INSTALLATION        about.php       css         img         lib         sample_synteny.txt  summary.php     ws

How is it possible to access localhost/index.php and localhost/mGSV/index.php I tried the following nginx's default.conf but they both point to the same index.php file?

server {
    listen  80;

    root /usr/share/nginx/html/;
    index index.php index.html index.html;

    server_name localhost;

    location / {
        try_files $uri /index.php$is_args$args;
    }

    location /mGSV {
        try_files $uri /index.php$is_args$args;
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass phpfpm:9000;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

And my docker-compose.yml file looks like this:

nginx:
    image: nginx
    restart: always
    ports:
        - "80:80"
    links:
        - phpfpm
        - db
    volumes:    
        - ./logs/nginx-error.log:/var/log/nginx/error.log
        - ./logs/nginx-access.log:/var/log/nginx/access.log

        - ./nginx/default:/etc/nginx/conf.d/default.conf

phpfpm:
    build: php5-fpm
    restart: always
    ports:
        - "9000:9000"
    links:
        - db
    volumes:
        - ./public:/usr/share/nginx/html

db:
  image: mariadb
  restart: always
  environment:
    - MYSQL_ROOT_PASSWORD=admin
    - MYSQL_DATABASE=mgsv
    - MYSQL_USER=mgsv_user
    - MYSQL_PASSWORD=mgsvpass
  ports:
    - "3306:3306"
  volumes:
    - ./mysql/:/docker-entrypoint-initdb.d

phpmyadmin:
  image: phpmyadmin/phpmyadmin
  restart: always
  links:
    - db
  ports:
    - 8183:80
  environment:
    PMA_USER: root
    PMA_PASSWORD: admin
    PMA_ARBITRARY: 1

Thank you in advance

user977828
  • 205
  • 4
  • 15

0 Answers0