0

compose up successfully and visit to the browser myapp.local, it will not load and it will go to google search. but if I type http://myapp.local it will load correctly. I think my Nginx is not doing good for redirecting. I already have in my etc/host

127.0.0.1 myapp.local

Here is my nginx

server {
            listen 80;
            listen [::]:80;

            # For https
            # listen 443 ssl;
            # listen [::]:443 ssl ipv6only=on;
            # ssl_certificate /etc/nginx/ssl/default.crt;
            # ssl_certificate_key /etc/nginx/ssl/default.key;

            server_name myapp.local;
            root /var/www/myapp/public;
            index index.php index.html index.htm;

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

        resolver 127.0.0.11;
         set $upstream php:9000;
         location ~ \.php$ {
                 try_files $uri /index.php =404;
                 fastcgi_pass $upstream;
                 fastcgi_index index.php;
                 fastcgi_buffers 16 16k;
                 fastcgi_buffer_size 32k;
                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                 #fixes timeouts
                 fastcgi_read_timeout 600;
                 include fastcgi_params;
             }

          location ~ /\.ht {
                 deny all;
             }

             location /.well-known/acme-challenge/ {
                 root /var/www/letsencrypt/;
                 log_not_found off;
             }

             error_log /var/log/nginx/laravel_error.log;
             access_log /var/log/nginx/laravel_access.log;
     }

Thank you in advance

jemz
  • 4,987
  • 18
  • 62
  • 102

0 Answers0