header-icon pg数据库如何保存 03/22/2023 18:16:16.209 这种时间类型
时间: 2023-05-19 10:07:10 浏览: 49
可以使用 timestamp 类型来保存这种时间类型,具体的 SQL 语句如下:
CREATE TABLE mytable (
id SERIAL PRIMARY KEY,
header_icon TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
其中,header_icon 是保存 header-icon 的字段,created_at 是保存时间戳的字段,使用 DEFAULT CURRENT_TIMESTAMP 可以让数据库自动保存当前时间。
相关问题
配置从weixin.landa.com.cn:7001/learning-mobile到http://172.75.200.166:8077/learning-mobile的代理
首先,您需要确保您有一台可以作为代理服务器的计算机,并且安装了一个代理软件,例如 Nginx 或 Apache。
然后,您需要编辑代理软件的配置文件,将请求从 weixin.landa.com.cn:7001/learning-mobile 重定向到 http://172.75.200.166:8077/learning-mobile。
具体配置方法可能因代理软件的不同而有所差异,以下是 Nginx 的配置示例:
```
server {
listen 7001;
server_name weixin.landa.com.cn;
location /learning-mobile/ {
proxy_pass http://172.75.200.166:8077/learning-mobile/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
```
请注意,以上配置仅供参考,您可能需要根据您的实际情况进行调整。
希望以上内容能帮到您!
https://ret-auto.com:9443/charge/weChat/getOpenId?code=0c1qrbGa1NRZDF0E93Ga1ozBXk1qrbGA 转192.168.1.18:9003 '/charge/(.*)': { target: 'http://192.168.1.18:9003/', changeOrigin: true, pathRewrite: { '/charge': '', // rewrite path } }没转成功
根据你提供的配置,将`https://ret-auto.com:9443/charge/weChat/getOpenId?code=0c1qrbGa1NRZDF0E93Ga1ozBXk1qrbGA`转发到`http://192.168.1.18:9003/charge/weChat/getOpenId?code=0c1qrbGa1NRZDF0E93Ga1ozBXk1qrbGA`的Nginx配置如下:
1. 打开Nginx的配置文件(通常是在`/etc/nginx/nginx.conf`或`/etc/nginx/conf.d/default.conf`中)。
2. 在`http`块中,找到或添加一个名为`location`的块,并在其中添加以下配置:
```
location /charge/ {
proxy_pass http://192.168.1.18:9003/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
```
3. 保存并关闭配置文件。
4. 检查Nginx配置文件是否正确:
运行以下命令检查Nginx配置文件是否正确:
```
sudo nginx -t
```
5. 重启Nginx服务:
如果配置文件没有错误,使用以下命令重启Nginx服务以使更改生效:
```
sudo systemctl restart nginx
```
现在,当访问`https://ret-auto.com:9443/charge/weChat/getOpenId?code=0c1qrbGa1NRZDF0E93Ga1ozBXk1qrbGA`时,Nginx将会将请求转发到`http://192.168.1.18:9003/charge/weChat/getOpenId?code=0c1qrbGa1NRZDF0E93Ga1ozBXk1qrbGA`。确保目标服务器(192.168.1.18:9003)正在运行,并检查Nginx的访问日志和错误日志以排除任何问题。