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

Nginx support? #7

Open
rickmills opened this issue Jul 15, 2018 · 5 comments
Open

Nginx support? #7

rickmills opened this issue Jul 15, 2018 · 5 comments

Comments

@rickmills
Copy link

rickmills commented Jul 15, 2018

I noticed this mainly uses a htaccess file which is an apache specific thing. Is there any plans to support nginx given this is all about performance? Nginx can be configured to be significantly faster than apache :)

@tobias-kuendig
Copy link
Member

Unfortunately nginx doesn't make it easy to provide additional configuration at runtime.

With .htaccess files we can tune apache for a single website without needing access to the whole configuration. We cannot dynamically edit nginx's configuration under /etc via PHP.

We could, however, provide some nginx performance tips in the README.

@multiwebinc
Copy link

multiwebinc commented Nov 9, 2018

To get server push to work for Nginx I actually just used https://github.com/JacobBennett/laravel-HTTP2ServerPush, which this is based on.

In my site's conf file I had to make the following changes:

listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_ciphers         HIGH:!aNULL:!MD5;
location / {
    # append the following
    http2_push_preload on;
    fastcgi_buffers 16 16k;
    fastcgi_buffer_size 32k;
}

Then restart Nginx and follow the installation instructions in the above link.

@tobias-kuendig
Copy link
Member

If you are using the speedy plugin you don't have to install an additional package. With http2 support enabled, this plugin will add the Link headers already. The nginx config will have to be patched manually, though.

What you won't get out-of-the-box on nginx is any of the caching headers that this plugin adds via the .htaccess file.

@multiwebinc
Copy link

It didn't seem to do anything for me for some reason. That's why I installed that other package, then it worked right away.

@Samuell1
Copy link

If anybody wants to use gzip with nginx you can add this code to ngix directives:

gzip on;
gzip_disable "MSIE [1-6]\\.(?!.*SV1)";
gzip_proxied any;
gzip_comp_level 5;
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript image/x-icon image/bmp image/svg+xml;
gzip_vary on;

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

4 participants