GithubHelp home page GithubHelp logo

emazzotta / docker-nginx-lua Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 8.0 18.72 MB

๐Ÿณ Dockerized Nginx with modules "more_set_headers", "ngx_pagespeed" and "accept-language"

License: MIT License

Dockerfile 90.73% Makefile 9.27%

docker-nginx-lua's Introduction

Build Status License Docker Pulls

Docker Nginx

A Docker project for a recent version of the Nginx webserver and the module more_set_headers to specify custom headers such as a server name like 1337-server instead of nginx or apache. Another module this nginx build contains is Google's ngx_pagespeed module

Usage

docker run -v <my_conf_dir>:/etc/nginx/conf.d -v /var/ngx_pagespeed_cache -p 80:80 emazzotta/docker-nginx-lua

Note

While this project is called "docker-nginx-lua" I've dropped the support for LuaJit, see #3

Examples

More Set Headers

http {
    ...
    more_set_headers 'Server: 1337-server';
    ...
}

Accept Language Module

server {   
    ...
    location ~ / {
        set_from_accept_language $lang en de;
        if ( $request_uri ~ ^/$  ) {
            rewrite ^/$ /$lang redirect;
            break;
        }
    }
    ...
}

Pagespeed

server {
    ...
    pagespeed on;
    pagespeed FileCachePath /var/cache/nginx;
    pagespeed XHeaderValue "Pagespeed";
    pagespeed RewriteLevel CoreFilters;
    ...
}

Author

Emanuele Mazzotta

License

FOSSA Status

docker-nginx-lua's People

Contributors

emazzotta avatar fossabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker-nginx-lua's Issues

Unknown directive "rewrite_by_lua"

"-"
nginx_1 | 2019/05/28 08:33:40 [emerg] 9#9: unknown directive "rewrite_by_lua" in /etc/nginx/conf.d/default.conf:48
nginx_1 | nginx: [emerg] unknown directive "rewrite_by_lua" in /etc/nginx/conf.d/default.conf:48
nginx_1 | 2019/05/28 08:34:43 [emerg] 7#7: unknown directive "rewrite_by_lua" in /etc/nginx/conf.d/default.conf:47
nginx_1 | nginx: [emerg] unknown directive "rewrite_by_lua" in /etc/nginx/conf.d/default.conf:47
nginx_1 | 2019/05/28 08:35:20 [emerg] 7#7: unknown directive "rewrite_by_lua" in /etc/nginx/conf.d/default.conf:47
nginx_1 | nginx: [emerg] unknown directive "rewrite_by_lua" in /etc/nginx/conf.d/default.conf:47

openresty warnings

At the moment I'm using your image for the more-headers module, but I would also like to use the lua module eventually. Are these warnings significant?

2020/02/03 09:08:03 [alert] 1#0: detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
nginx: [alert] detected a LuaJIT version which is not OpenResty's; many optimizations will be disabled and performance will be compromised (see https://github.com/openresty/luajit2 for OpenResty's LuaJIT or, even better, consider using the OpenResty releases from https://openresty.org/en/download.html)
2020/02/03 09:08:03 [error] 1#0: lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found:
no field package.preload['resty.core']
no file './resty/core.lua'
no file '/usr/local/share/luajit-2.0.5/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core/init.lua'
no file './resty/core.so'
no file '/usr/local/lib/lua/5.1/resty/core.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so')
nginx: [error] lua_load_resty_core failed to load the resty.core module from https://github.com/openresty/lua-resty-core; ensure you are using an OpenResty release from https://openresty.org/en/download.html (rc: 2, reason: module 'resty.core' not found:
no field package.preload['resty.core']
no file './resty/core.lua'
no file '/usr/local/share/luajit-2.0.5/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core.lua'
no file '/usr/local/share/lua/5.1/resty/core/init.lua'
no file './resty/core.so'
no file '/usr/local/lib/lua/5.1/resty/core.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.