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

Subdomain configuration #48

Closed
kevindesousa opened this issue Oct 3, 2018 · 7 comments
Closed

Subdomain configuration #48

kevindesousa opened this issue Oct 3, 2018 · 7 comments

Comments

@kevindesousa
Copy link

Hello,

I think, it can be a good feature to set a custom subdomain instead a path on the principal domain.

We can have docs.mydomain.tld for example.

@phannaly
Copy link
Contributor

phannaly commented Oct 3, 2018

@kevindesousa You can use subdomain but still have docs in URL. If you want to remove docs without touching code, you can reverse domain.com/docs/ to sub.domain.com through nginx.

@saleem-hadad saleem-hadad mentioned this issue Oct 3, 2018
21 tasks
@saleem-hadad
Copy link
Owner

As @phannaly said you can configure that easily using nginx, or you can put your code on a sub-domain and then change the docs route to empty one to point to docs.domain.com instead of 'docs.domain.com/docs'.
However, we'll consider this feature in the future development (#6).
Thank you 👍

@kevindesousa
Copy link
Author

Hello,
Thanks for the solution.
But I want to do this with nginx, but I don't know how.

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

Can you help me please ?

@phannaly
Copy link
Contributor

Hi @saleem-hadad Are you developing this PR? If not I think we should probably make a document about subdomain on our docs how to do this.

@awebartisan
Copy link

Hi, any leads on this issue?

@mowses
Copy link

mowses commented Jun 10, 2020

Hello,
Thanks for the solution.
But I want to do this with nginx, but I don't know how.

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

Can you help me please ?

I dont know how to do it too, anyone help?

@saleem-hadad
Copy link
Owner

This is an example of Nginx config you need

# listen to port 80 here
...

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name subdomain.example.com;
    root /root/to/your/public/folder/in/laravel;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-XSS-Protection "1; mode=block";
    add_header X-Content-Type-Options "nosniff";

    index index.html index.htm index.php;

    charset utf-8;

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

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}

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

5 participants