@zhongdao
2022-03-27T14:20:51.000000Z
字数 3247
阅读 1251
未分类
go run main.go api.go
https://go.dev/doc/tutorial/call-module-code
<home>/|-- greetings/|-- hello/
go mod init example.com/greetings
https://go.dev/doc/tutorial/database-access
提示:
go run .[mysql] 2022/03/14 15:20:19 connector.go:95: could not use requested auth plugin 'mysql_native_password': this user requires mysql native password authentication.2022/03/14 15:20:19 this user requires mysql native password authentication.exit status 1
解决办法:
https://www.icode9.com/content-2-1262929.html
Golang下的ORM框架gorm的介绍和使用
https://juejin.cn/post/6844904090196000775
粘贴时正常
.vimrc
let &t_SI .= "\<Esc>[?2004h"let &t_EI .= "\<Esc>[?2004l"inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()function! XTermPasteBegin()set pastetoggle=<Esc>[201~set pastereturn ""endfunction
Nginx入门教程
https://zhuanlan.zhihu.com/p/162773974
查看nginx的版本号
./nginx -v
启动nginx
./nginx
关闭nginx
./nginx -s stop
重新加载nginx
根据请求后缀分发
server {listen 7001;server_name 47.104.xxx.xxx;location ~ /dev/ {proxy_pass http://127.0.0.1:8080;}location ~ /prod/ {proxy_pass http://127.0.0.1:8081;}}
/etc/nginx/sites-available/default
server {# SSL configuration## listen 443 ssl default_server;# listen [::]:443 ssl default_server;## Note: You should disable gzip for SSL traffic.# See: https://bugs.debian.org/773332## Read up on ssl_ciphers to ensure a secure configuration.# See: https://bugs.debian.org/765782## Self signed certs generated by the ssl-cert package# Don't use them in a production server!## include snippets/snakeoil.conf;#root /var/www/html;root /root/src/ttip-front-end/build;# Add index.php to the list if you are using PHPindex index.html index.htm index.nginx-debian.html;server_name ttip.chinafilm-hualong.com; # managed by Certbotlocation / {# First attempt to serve request as file, then# as directory, then fall back to displaying a 404.#proxy_pass http://localhost:8888;try_files $uri $uri/ =404;}location /httpd {proxy_pass http://localhost:8999;}location /kdmplatform {proxy_pass http://localhost:18182;}location /operation {proxy_pass http://localhost:18183;}location /security {proxy_pass http://localhost:18184;}# pass PHP scripts to FastCGI server##location ~ \.php$ {# include snippets/fastcgi-php.conf;## # With php-fpm (or other unix sockets):# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;# # With php-cgi (or other tcp sockets):# fastcgi_pass 127.0.0.1:9000;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {# deny all;#}listen [::]:443 ssl ipv6only=on; # managed by Certbotlisten 443 ssl; # managed by Certbotssl_certificate /etc/letsencrypt/live/ttip.chinafilm-hualong.com/fullchain.pem; # managed by Certbotssl_certificate_key /etc/letsencrypt/live/ttip.chinafilm-hualong.com/privkey.pem; # managed by Certbotinclude /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbotssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot}server {if ($host = ttip.chinafilm-hualong.com) {return 301 https://$host$request_uri;} # managed by Certbotlisten 80 ;listen [::]:80 ;server_name ttip.chinafilm-hualong.com;return 404; # managed by Certbot}
sudo apt-get remove certbotsudo snap install --classic certbot#根据提示配置域名sudo certbot --nginx#追加域名certbot --expand -d yourdomain#生成独立的证书和私钥(不配置nginx),需要80端口不被占用certbot certonly --standalone --preferred-challenges http -d yourstandalonedomain
