LoginSignup
1
0

More than 3 years have passed since last update.

Nginx で Laravel と phpMyAdmin を使う

Posted at

Nginx で Laravel と phpMyAdmin を使う時の設定ファイルです。

Ubuntu 20.10 で確認しました。

/etc/nginx/sites-available/defalt
server {
        listen 80 default_server;
        listen [::]:80 default_server;
        #
        root /var/www/html;
        server_name _;

        location / {
               try_files $uri $uri/ /index.php?$query_string;
        }

        location ~ \.php$ {
                include snippets/fastcgi-php.conf;
        #
               fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        }

        location  ^~ /phpmyadmin {
                root /usr/share;
                index index.html index.htm index.php;

                location ~ \.php$ {
                        include snippets/fastcgi-php.conf;
                        fastcgi_pass unix:/run/php/php7.4-fpm.sock;
                }
        }

}

設定ファイルが正しいか確認

$ sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Nginx の再起動

sudo systemctl restart nginx
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0