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 2021/07/25 05:39:04 UTC

[GitHub] [apisix] tzssangglass opened a new pull request #4663: docs: Add some questions and answers to the FAQ

tzssangglass opened a new pull request #4663:
URL: https://github.com/apache/apisix/pull/4663


   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   Collate some common questions from the community and issue
   
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   * [x] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [x] Have you modified the corresponding document?
   * [x] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first**
   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tokers commented on a change in pull request #4663: docs: Add some questions and answers to the FAQ

Posted by GitBox <gi...@apache.org>.
tokers commented on a change in pull request #4663:
URL: https://github.com/apache/apisix/pull/4663#discussion_r676231362



##########
File path: docs/en/latest/FAQ.md
##########
@@ -552,3 +552,406 @@ apisix:
 **Note:**
 
 - Whenever trying to connect TLS services with cosocket, you should set `apisix.ssl.ssl_trusted_certificate`
+
+An example, if using Nacos as a service discovery in APISIX, Nacos has TLS protocol enabled, i.e. Nacos configuration `host` starts with `https://`, so you need to configure `apisix.ssl.ssl_trusted_certificate` and use the same CA certificate as Nacos.
+
+## Proxy static files with APISIX, how to configure routes
+
+Proxy static files with Nginx, for example:
+
+```nginx
+location ~* .(js|css|flash|media|jpg|png|gif|ico|vbs|json|txt)$ {
+...
+}
+```
+
+In `nginx.conf`, this means matching requests with js, css, etc. as a suffix. This configuration can be converted into a route with regular matching for APISIX, for example:
+
+```json
+{
+    "uri": "/*",
+    "vars": [
+        ["uri", "~~", ".(js|css|flash|media|jpg|png|gif|ico|vbs|json|txt)$"]
+    ]
+}
+```
+
+## How to fix `module 'resty.worker.events' not found` error
+
+Installing APISIX under the `/root` directory causes this problem. Because the worker process is run by nobody, it does not have access to the files in the `/root` directory. You need to move the APISIX installation directory, and it is recommended to install it in the `/usr/local` directory.

Review comment:
       ```suggestion
   Installing APISIX under the `/root` directory causes this problem. Because the worker process is run by the user `nobody`, it does not have enough permissions to access the files in the `/root` directory. You need to change the APISIX installation directory, and it is recommended to install it in the `/usr/local` directory.
   ```

##########
File path: docs/en/latest/FAQ.md
##########
@@ -552,3 +552,406 @@ apisix:
 **Note:**
 
 - Whenever trying to connect TLS services with cosocket, you should set `apisix.ssl.ssl_trusted_certificate`
+
+An example, if using Nacos as a service discovery in APISIX, Nacos has TLS protocol enabled, i.e. Nacos configuration `host` starts with `https://`, so you need to configure `apisix.ssl.ssl_trusted_certificate` and use the same CA certificate as Nacos.
+
+## Proxy static files with APISIX, how to configure routes
+
+Proxy static files with Nginx, for example:
+
+```nginx
+location ~* .(js|css|flash|media|jpg|png|gif|ico|vbs|json|txt)$ {
+...
+}
+```
+
+In `nginx.conf`, this means matching requests with js, css, etc. as a suffix. This configuration can be converted into a route with regular matching for APISIX, for example:
+
+```json
+{
+    "uri": "/*",
+    "vars": [
+        ["uri", "~~", ".(js|css|flash|media|jpg|png|gif|ico|vbs|json|txt)$"]
+    ]
+}
+```
+
+## How to fix `module 'resty.worker.events' not found` error
+
+Installing APISIX under the `/root` directory causes this problem. Because the worker process is run by nobody, it does not have access to the files in the `/root` directory. You need to move the APISIX installation directory, and it is recommended to install it in the `/usr/local` directory.
+
+## How to get the real Client IP in APISIX
+
+This feature relies on the [Real IP](http://nginx.org/en/docs/http/ngx_http_realip_module.html) module of Nginx, which is covered in the [APISIX-OpenResty](https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-openresty.sh) script.
+
+There are 3 directives in the Real IP module
+
+- set_real_ip_from
+- real_ip_header
+- real_ip_recursive
+
+The following describes how to use these three directives in the specific scenario.
+
+1. Client -> APISIX -> Upstream
+
+When the Client connects directly to APISIX, no special configuration is needed, APISIX can automatically get the real Client IP.
+
+2. Client -> Nginx -> APISIX -> Upstream

Review comment:
       You should tell the readers that `Nginx` here is just an example, other intermediate proxies are similar, like AWS cloudfront.

##########
File path: docs/en/latest/FAQ.md
##########
@@ -552,3 +552,406 @@ apisix:
 **Note:**
 
 - Whenever trying to connect TLS services with cosocket, you should set `apisix.ssl.ssl_trusted_certificate`
+
+An example, if using Nacos as a service discovery in APISIX, Nacos has TLS protocol enabled, i.e. Nacos configuration `host` starts with `https://`, so you need to configure `apisix.ssl.ssl_trusted_certificate` and use the same CA certificate as Nacos.

Review comment:
       ```suggestion
   As an example, if using Nacos as a service discovery in APISIX, and Nacos has TLS protocol enabled, i.e. Nacos configuration `host` starts with `https://`, so you need to configure `apisix.ssl.ssl_trusted_certificate` and use the same CA certificate as Nacos.
   ```

##########
File path: docs/en/latest/FAQ.md
##########
@@ -552,3 +552,406 @@ apisix:
 **Note:**
 
 - Whenever trying to connect TLS services with cosocket, you should set `apisix.ssl.ssl_trusted_certificate`
+
+An example, if using Nacos as a service discovery in APISIX, Nacos has TLS protocol enabled, i.e. Nacos configuration `host` starts with `https://`, so you need to configure `apisix.ssl.ssl_trusted_certificate` and use the same CA certificate as Nacos.

Review comment:
       Also, add the hyperlink for Nacos.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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



[GitHub] [apisix] tzssangglass closed pull request #4663: docs: Add some questions and answers to the FAQ

Posted by GitBox <gi...@apache.org>.
tzssangglass closed pull request #4663:
URL: https://github.com/apache/apisix/pull/4663


   


-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

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