New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valet Configuration #2

Open
nearkingdom opened this Issue Nov 21, 2018 · 5 comments

Comments

Projects
None yet
2 participants
@nearkingdom
Copy link

nearkingdom commented Nov 21, 2018

Hi Andrew,

Been trying to get Perch Runway working with Valet. Wondering if you would be keen to compare notes on your configuration? I understand a driver is needed but wondering if I have to configure the nginx config file created by Valet for the site?

Warm Regards,

Dan

@andocobo

This comment has been minimized.

Copy link
Owner

andocobo commented Nov 21, 2018

Hi Dan,
The driver I made was only for regular Perch, not Perch Runway - it’s actually not required for Perch anymore, it just works now.

It’s actually not too hard to create a custom driver for valet, it’s covered pretty well in the docs.

Cheers,
Andrew

@nearkingdom

This comment has been minimized.

Copy link

nearkingdom commented Nov 22, 2018

Hi Andrew,

Checking this through it looks like I can access the Perch admin when using Valet (with no custom driver) but I get a 404 error when viewing the actual site. Do you think I need to update the config file created by Valet to replicate the Perch rewrite rule normally required in Apache?

# Perch Runway (.htaccess)
RewriteCond %{REQUEST_URI} !^/login
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* /login/core/runway/start.php [L]

Valet Config File

server {
    listen 80;
    server_name armstrong.test www.armstrong.test *.armstrong.test;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    server_name armstrong.test www.armstrong.test *.armstrong.test;
    root /;
    charset utf-8;
    client_max_body_size 128M;

    location /41c270e4-5535-4daa-b23e-c269744c2f45/ {
        internal;
        alias /;
        try_files $uri $uri/;
    }

    ssl_certificate /Users/danlee/.valet/Certificates/armstrong.test.crt;
    ssl_certificate_key /Users/danlee/.valet/Certificates/armstrong.test.key;

    location / {
        rewrite ^ /Users/danlee/.composer/vendor/laravel/valet/server.php last;
    }

    access_log off;
    error_log /Users/danlee/.valet/Log/nginx-error.log;

    error_page 404 /Users/danlee/.composer/vendor/laravel/valet/server.php;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/Users/danlee/.valet/valet.sock;
        fastcgi_index /Users/danlee/.composer/vendor/laravel/valet/server.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME /Users/danlee/.composer/vendor/laravel/valet/server.php;
    }

    location ~ /\.ht {
        deny all;
    }
}
@andocobo

This comment has been minimized.

Copy link
Owner

andocobo commented Nov 22, 2018

@andocobo

This comment has been minimized.

Copy link
Owner

andocobo commented Nov 22, 2018

@nearkingdom

This comment has been minimized.

Copy link

nearkingdom commented Nov 22, 2018

Yeah, this is new territory for me too... I have documented the problem on the Perch forums if it is of interest... http://forum.grabaperch.com/forum/11-22-2018-perch-runway-and-laravel-valet-setup-nginx

Thanks for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment