You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/29 11:38:09 UTC

[GitHub] [apisix] nanamikon opened a new issue #2565: support include other nginx config in the apisix(lua file)

nanamikon opened a new issue #2565:
URL: https://github.com/apache/apisix/issues/2565


   ### Issue description
   I can find that apisix use template to generate nginx.conf in the apisix(lua file),   we need to change this file  in following scenarios in my company
   - Setting third nginx module param;
   - Setting nginx params not supported in config.ymal
   - Export other servers  and locations which third nginx module needed
   
   What's about adding a new feature, for example,  support including other nginx conf file in the  apisix(lua file)
   Thank you!
   
   ### Environment
   
   * apisix version (master):
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen edited a comment on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
nic-chen edited a comment on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719114815


   Could you please show some example?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-722755664


   @nanamikon 
   I think we can write them in a literal block, see `literal_block` in https://learnxinyminutes.com/docs/yaml/. We should take care about the indentation of Nginx configuration. But once the configuration is indented, it is suitable in the yaml file.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander closed issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
spacewander closed issue #2565:
URL: https://github.com/apache/apisix/issues/2565


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719163843


   I will vote for ingress-nginx's snippet feature: 
   https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#configuration-snippet
   
   This feature can be configured directly in the yaml file.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719181158


   > I will vote for ingress-nginx's snippet feature: 
   > 
   > https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#configuration-snippet
   > 
   > 
   > 
   > This feature can be configured directly in the yaml file.
   
   agree +1


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nic-chen commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
nic-chen commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719114815


   Could you show some example?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719163225


   You mean like the nginx_http_include directive from kong?
   
   ```
   nginx_http_include = /path/to/your/extend.conf
   ```
   
   the `extend.conf` may be like 
   
   ```conf
   lua_shared_dict custom_plugin_a_cache 8m;
   lua_shared_dict custom_plugin_b_cache 8m;
   ```
   
   then this configuration will appear in the `nginx.conf`
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nanamikon commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
nanamikon commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719153151


   Sure!
   For example
   ```
   req_status_zone host "$server_name" 200M;
   req_status_zone hostadr "$server_name:$upstream_addr" 200M;
   req_status host hostadr;
   req_status_lazy on;
   
   server
   {
       listen 45651;
       server_name _;
       access_log off;
   
       location /ysec_status {
           req_status_show;
           allow 127.0.0.1;
           deny all;
       }
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] spacewander commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
spacewander commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719337777


   @tzssangglass 
   Configure `lua_shared_dict` is already supported: https://github.com/apache/apisix/blob/1fb000c92e9252c5872a83278cb44652ebdfe4d5/conf/config-default.yaml#L142
   
   Why do you think this feature can't be supported via snippets?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719385640


   > @tzssangglass
   > Configure `lua_shared_dict` is already supported:
   > 
   > https://github.com/apache/apisix/blob/1fb000c92e9252c5872a83278cb44652ebdfe4d5/conf/config-default.yaml#L142
   > 
   > Why do you think this feature can't be supported via snippets?
   
   Good. I had misconceptions about snippets before. I'm not sure if all the configurations can be translated from `yaml` to the final `nginx.conf`, so I thought if the ability to load extend.conf could be provided, there could be a back up plan.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] tzssangglass commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
tzssangglass commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719252079


   I doubt this will solve the renaming configuration, e.g. I want to configure multiple `lua_shared_dict` 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nanamikon edited a comment on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
nanamikon edited a comment on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719153151


   Sure!
   For example
   
   Third-party nginx module param 
   ``` 
   req_status_zone host "$server_name" 200M;
   req_status_zone hostadr "$server_name:$upstream_addr" 200M;
   req_status host hostadr;
   req_status_lazy on;
   
   server
   {
       listen 45651;
       server_name _;
       access_log off;
   
       location /ysec_status {
           req_status_show;
           allow 127.0.0.1;
           deny all;
       }
   }
   ```
   
   
   Other not support nginx param
   ```
   gzip             on;
   gzip_comp_level  6;
   gzip_min_length  1k;
   gzip_buffers     4 8k;
   gzip_disable     "MSIE [1-6]\.(?!.*SV1)";
   gzip_types       text/plain application/x-javascript text/css application/xml text/javascript application/javascript application/json;
   ``` 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nanamikon commented on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
nanamikon commented on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-720369064


   > I will vote for ingress-nginx's snippet feature:
   > https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#configuration-snippet
   > 
   > This feature can be configured directly in the yaml file.
   
   Good idea , most of situation can be covered。
   
   ```
   server
   {
       listen 45651;
       server_name _;
       access_log off;
   
       location /ysec_status {
           req_status_show;
           allow 127.0.0.1;
           deny all;
       }
   }
   ```
   But I think this format of config is not suitable to write to ymal  


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix] nanamikon edited a comment on issue #2565: support include other nginx config in the apisix(lua file)

Posted by GitBox <gi...@apache.org>.
nanamikon edited a comment on issue #2565:
URL: https://github.com/apache/apisix/issues/2565#issuecomment-719153151


   Sure!
   For example
   
   Third-party nginx module param 
   ``` 
   req_status_zone host "$server_name" 200M;
   req_status_zone hostadr "$server_name:$upstream_addr" 200M;
   req_status host hostadr;
   req_status_lazy on;
   
   server
   {
       listen 45651;
       server_name _;
       access_log off;
   
       location /ysec_status {
           req_status_show;
           allow 127.0.0.1;
           deny all;
       }
   }
   ```
   
   
   Other not support nginx param
   ```
   gzip             on;
   	gzip_comp_level  6;
   	gzip_min_length  1k;
   	gzip_buffers     4 8k;
   	gzip_disable     "MSIE [1-6]\.(?!.*SV1)";
   	gzip_types       text/plain application/x-javascript text/css application/xml text/javascript application/javascript application/json;
   ``` 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org