I have successfully installed Jetstream. npm run dev runs fine. However, I can only access the index page- all other pages including login and register return 404. Here's my setup :
server {
server_name example.com www.example.com;
listen [::]:443 ssl http2 ipv6only=on; # managed by Certbot
listen 443 ssl http2; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; # managed by Certbot
#include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
add_header Strict-Transport-Security "max-age=15768000" always;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
server_tokens off;
ssl_buffer_size 8k;
ssl_protocols TLSv1.2 TLSv1.1 TLSv1;
ssl_ecdh_curve secp384r1;
ssl_session_tickets off;
charset utf-8;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8;
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9001;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
root /var/www/html/public;
index index.php index.html;
charset utf-8;
location ~ /\.(?!well-known).* {
deny all;
}
}
My Laravel .env file has this configuration:
APP_URL=http://localhost
My docker-compose.yml file looks like this:
version: "3.7"
services:
app:
build:
args:
user: sammy
uid: 1000
context: ./
dockerfile: Dockerfile
image: laraapp
container_name: laraapp-app
restart: unless-stopped
working_dir: /var/www/html/
volumes:
- web-root:/var/www/html
ports:
- "9001:9000"
networks:
- laranet
db:
image: mysql/mysql-server:8.0
container_name: laraapp-db
restart: unless-stopped
tty: true
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_USER: ${DB_USERNAME}
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- ./mysql:/etc/mysql/conf.d/
- mysqldata:/var/lib/mysql
networks:
- laranet
nginx:
image: nginx:1.21-alpine
container_name: laraapp-nginx
tty: true
restart: unless-stopped
ports:
- "8444:443"
volumes:
- web-root:/var/www/html
- ./nginx:/etc/nginx/conf.d/
depends_on:
- app
networks:
- laranet
networks:
laranet:
driver: bridge
# Volumes
volumes:
mysqldata:
web-root:
driver: local
driver_opts:
type: none
device: /home/sammy/laraapp/src/
o: bind
I have a NGINX reverse proxy on my host machine forwarding requests to post 8444 like so:
location / {
try_files $uri $uri/ =404;
proxy_pass https://localhost:8444;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name;
}
php artisan route:list returns all the correct app routes.