Skip to content
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

Run Kutr on Web with a domain #10

Open
popouille opened this issue May 3, 2018 · 1 comment
Open

Run Kutr on Web with a domain #10

popouille opened this issue May 3, 2018 · 1 comment

Comments

@popouille
Copy link

How to run it with domain.

Can we run it with a domain as the server needs to be started with 127.0.0.1 and a port by php artisan serve

i can acess the login page with my http://www.domain.com, but i can't login. But if i artisan serve on my IP server with php artisan serve --host=... then i access http://...:port i can login.

Thank you

@X-Ryl669
Copy link
Owner

X-Ryl669 commented May 6, 2018

I'm not using php's internal HTTP server but nginx as a reverse proxy for php-fpm. This is much more efficient, and easier to maintain. Using a domain is straightforward with nginx, here's my configuration for the subdomain:

server {
    listen       80;
    server_name  music.domain.com;

    root  /srv/www/path/to/public_html/kutr;
    access_log /srv/www/path/to/logs/kutr.access.log;
    error_log /srv/www/path/to/logs/kutr.error.log;
    index index.php;

  # Whitelist only index.php, robots.txt, and those start with public/ or api/
  if ($request_uri !~ ^/$|index\.php|loginRedir\.php|robots\.txt|api/|public/) {
    return 404;
  }

  location /media/ {
    internal;

    # A 'X-Media-Root' should be set to media_path settings from upstream
    alias       $upstream_http_x_media_root;
  }

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

  location ~ \.php$ {
    try_files $uri $uri/ /index.php?$args;

    fastcgi_param     PATH_INFO $fastcgi_path_info;
    fastcgi_param     PATH_TRANSLATED $document_root$fastcgi_path_info;
    fastcgi_param     SCRIPT_FILENAME $document_root$fastcgi_script_name;

    fastcgi_pass unix:/run/php/php7.0-fpm.sock; #/tmp/php.sock;
    fastcgi_index             index.php;
    fastcgi_split_path_info   ^(.+\.php)(/.+)$;
    fastcgi_intercept_errors  on;
    include                   fastcgi_params;
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants