AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-578315

aks's questions

Martin Hope
aks
Asked: 2022-01-08 01:30:26 +0800 CST

挂载持久卷时,Kubernetes pod 中的内容为空

  • 2

持久卷声明和持久卷 yaml 文件

apiVersion: v1
kind: PersistentVolume
metadata:
  name: my-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/mnt/datatypo"


---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-claim
spec:
  storageClassName: manual
  volumeName: my-volume
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi

部署 yaml 文件

apiVersion: v1
kind: Service
metadata:
  name: typo3
  labels:
    app: typo3
spec:
  type: NodePort
  ports:
    - nodePort: 31021
      port: 80
      targetPort: 80
  selector:
    app: typo3
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: typo3
spec:
  selector:
    matchLabels:
      app: typo3
  replicas: 1
  template:
    metadata:
      labels:
        app: typo3
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: app
                operator: In
                values:
                - typo3
      containers:
      - image: image:typo3
        name: typo3
        imagePullPolicy: Never
        ports:
        - containerPort: 80
        volumeMounts:
         - name: my-volume
           mountPath: /var/www/html/
      volumes:
           - name: my-volume
             persistentVolumeClaim:
                 claimName: my-claim

注意:如果未添加持久卷,则内容显示在 pod 内(在 中var/www/html)。但是在添加持久卷之后,它不会显示同一文件夹和外部挂载路径中的任何内容/mnt/datatypo。

cloud docker kubernetes yaml
  • 1 个回答
  • 544 Views
Martin Hope
aks
Asked: 2021-02-08 06:36:11 +0800 CST

如何为 Django 应用程序编写 nginx 代理通行证

  • 0

我在 AWS 服务器中部署了一个简单的 Django 应用程序,并在 Nginx 中创建了一个配置文件,如下所示。

                 server {
                         listen 80;
                         server_name 127.0.0.1;
                         location /portal {
                         include proxy_params;
                         proxy_pass http://localhost:8000;
                           }
                        }

但它不起作用并显示为“404 not found”。

Django 应用程序单独在 URL 中作为http://public_ip/en/工作,但我需要在http://public_ip/portal中提供此应用程序。

django rewrite nginx reverse-proxy proxypass
  • 1 个回答
  • 1384 Views
Martin Hope
aks
Asked: 2020-09-18 09:36:20 +0800 CST

需要支持写一个 Nginx 规则

  • 0

我已经在 7000 个端口中部署了我的前端应用程序。所以我需要在 Nginx 中编写一个规则,这样每当来自 7000(HTTP://example.com:7000)端口的所有 HTTP 请求都会自动将 HTTPS 重定向到同一端口(HTTPS://example.com:7000)

请支持我解决问题。这是我当前的 Nginx 配置文件

    server {       
    listen 7000 ssl;
    ssl_certificate /new_keys/new_k/ssl_certificate/star_file.crt;
    ssl_certificate_key /new_keys/new_k/ssl_certificate/private.key;

    root /home_directory;
    index index.html index.htm index.nginx-debian.html;
    server_name _;
    location / {
    try_files $uri $uri/ =404;
    }
    error_page 404 /custom_404.html;
    location = /custom_404.html {
            root /usr/share/nginx/html;
            internal;
    }
    }

笔记 :

  1. 在 7000 端口服务的应用程序 URL 是“http://example.com:7000/#/
  2. 80 端口已被另一个应用程序占用
  3. 目前我有一个通配符 SSL 证书
  4. 服务器 IP 仅指向单个域
web-server web-hosting nginx 301-redirect redirection
  • 2 个回答
  • 211 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve