{
only_from = 0.0.0.0
# or replace 0.0.0.0 with an IP range
# (i.e., 128.0.0.0/16) if desired
}
创建一个名为 /etc/xinetd.d/lookerhttps 的文件
将以下内容添加到文件中:
# default: on
# description: Redirect HTTPS/443 requests to
# Looker default port 9999
service https
{
disable = no
id = lookerhttps
socket_type = stream
protocol = tcp
user = root
wait = no
redirect = 127.0.0.1 9999
}
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-07-31。"],[],[],null,["# Port forwarding for a cleaner URL\n\nBy default, HTTPS assumes that the port will be 443. This means that `https://looker.yourdomain.com` would automatically be handled as though the user had typed `https://looker.yourdomain.com:443`. However, using the standard HTTPS port (443) would require running Looker as root, which is unsupported and not recommended.\n\nOne option is to have users specify a port number as part of the URL when they access Looker. For example, if you are using port 9999, then they would type: `https://looker.yourdomain.com:9999`.\n\nOn customer-hosted instances, for your users' convenience, we recommend setting up a different default port so they can type `https://looker.yourdomain.com` and still get to the correct port. You can set up a default port for Looker or redirect traffic to a different port using several methods:\n\n- Use the `--port=\u003ci\u003e` Looker startup option to specify the desired port, such as `--port=9999`. This option is discussed on the [Looker startup options](/looker/docs/startup-options) documentation page.\n- [Create a script that uses `iptables`](#iptables_on_the_looker_host).\n- [Use `xinetd`](#xinetd_on_the_looker_host).\n- [Use a Nginx reverse proxy server](#reverse_proxy_servers).\n- [Use a load balancer](#load_balancer).\n\n\u003e Note that it is better to forward packets directly to Looker, rather than indirectly (through a web proxy), because Looker has functionality to stop a database query when it detects that the browser has canceled a request.\n\niptables on the Looker host\n---------------------------\n\nLooker can be accessed from a different port by using iptables. The following script will forward traffic from port 443 to 9999. It was written for Ubuntu Linux and might need to be modified if you are running a different Linux distribution.\n\n1. Create the script file:\n\n /etc/network/if-up.d/looker-https-forward\n\n2. Add these contents to the file:\n\n #!/bin/sh\n # Forward HTTPS traffic to the Looker app\n iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 443 -j REDIRECT --to-port 9999\n\n3. Make it executable:\n\n sudo chmod 755 /etc/network/if-up.d/looker-https-forward\n\n4. Run the script, which will automatically run on the next system or network restart:\n\n sudo /etc/network/if-up.d/looker-https-forward\n\nxinetd on the Looker host\n-------------------------\n\nAnother technique involves using xinetd.\n\n1. Make sure xinetd allows incoming traffic from all desired addresses. In the default section of **/etc/xinetd.conf** add:\n\n {\n only_from = 0.0.0.0\n # or replace 0.0.0.0 with an IP range\n # (i.e., 128.0.0.0/16) if desired\n }\n\n2. Create a file named: `/etc/xinetd.d/lookerhttps`\n\n3. Add these contents to the file:\n\n # default: on\n # description: Redirect HTTPS/443 requests to\n # Looker default port 9999\n service https\n {\n disable = no\n id = lookerhttps\n socket_type = stream\n protocol = tcp\n user = root\n wait = no\n redirect = 127.0.0.1 9999\n }\n\nReverse proxy servers\n---------------------\n\nIt is possible to use reverse proxies with Looker. Our suggested reverse proxy server is Nginx. It is the only reverse proxy we test and fully support, although we don't necessarily prohibit other options. You can find a sample Nginx configuration on the [Sample Nginx configuration](/looker/docs/sample-nginx-configuration) documentation page.\n\u003e Note that the Apache reverse proxy has [a bug](https://bz.apache.org/bugzilla/show_bug.cgi?id=50807) in it that prevents Looker from being able to properly close connections. This means that every database query will run to completion, even if a user cancels it. For this reason, you should avoid using the Apache reverse proxy with Looker.\n\nLoad balancer\n-------------\n\nThere are many load balancers solutions available. From a high level, the load balancer would be configured to listen on port 443 and forward all requests to Looker on port 9999. In this case, your SSL server certificates would be installed on the load balancer.\n\nNext steps\n----------\n\nAfter you have configured port forwarding, you're ready to [allow Looker Support to access your deployment](/looker/docs/support-access-customer-hosted-deployment)."]]