因此,我想proxy_pass在我的服务器上由 Avahi 控制的 .local 区域中对 vagrant 机器进行动态化。我有一个 nginx 虚拟主机配置:
server {
listen 80;
server_name ~^(?<subdomain>.+)\.example\.com$;
location / {
resolver 127.0.0.1 valid=30s;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://$subdomain-example.local;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
}
}
Run Code Online (Sandbox Code Playgroud)
Nginx 在 /var/log/nginx/error.log 中返回了一个错误:
2016/09/26 18:03:34 [error] 24401#24401:
*1 no resolver defined to resolve test-example.local,
client: 192.168.1.101,
server: ~^(?<subdomain>.+)\.example\.com$,
request: "GET / HTTP/1.1",
host: "test.example.com"
Run Code Online (Sandbox Code Playgroud)
但是,例如,如果我手动设置$subdomain为“测试”,它就可以工作并按照我真正想要的方式传递到 test-example.local 机器。 …
我正在尝试从本地文件系统播放视频,视频播放器会显示,但视频甚至不会在手机上显示,或者甚至无法播放,我做错了什么吗?我确切知道我的文件所在的位置,但它无法播放它实际上是一个只有空白屏幕的视频播放器。?
这是我下面使用的代码,显示了一个空的视频播放器
import React from 'react';
import { StyleSheet, Text, View, Dimensions } from 'react-native';
import { Video } from 'expo';
import { MaterialIcons, Octicons } from '@expo/vector-icons';
export default class App extends React.Component {
state = {
mute: false,
shouldPlay: true,
}
handlePlayAndPause = () => {
this.setState((prevState) => ({
shouldPlay: !prevState.shouldPlay
}));
}
handleVolume = () => {
this.setState(prevState => ({
mute: !prevState.mute,
}));
}
render() {
const { width } = Dimensions.get('window');
return (
<View style={styles.container}>
<View> …Run Code Online (Sandbox Code Playgroud) 如何捆绑 git 项目而不需要每次都克隆它?现在我总是执行下面的命令。
git clone --mirror http://git_project
cd git_project
git bundle create '../git_project.lock' --all
cd ..
rm git_project -Force -Recurse
Run Code Online (Sandbox Code Playgroud)
我想用一个命令来完成此操作,例如:
git bundle create '../git_project.lock' --all --repository http://git_project
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用不同语言的动态用户内容构建一个站点。
例如:
<p lang="en">disestablishment</p>
<p lang="de">Käsekuchenbäckereibesitzer</p>
<p lang="fr">Consciencieuse</p>
<p lang="it">Imbarazzato</p>
<p lang="es">decepcionado</p>
Run Code Online (Sandbox Code Playgroud)
我正在使用 CSS 来激活断字:
p[lang] {
width: 60px;
-webkit-hyphens: auto;
-ms-hyphens: auto;
hyphens: auto;
}
Run Code Online (Sandbox Code Playgroud)
它似乎在我的机器上工作得很好,但我试图找出这是否也适用于其他平台和机器。所以我在 BrowserStack 上试了一下,得到了非常不同的结果:
| 无前缀 | 恩 | 德 | fr | 它 | es | |
|---|---|---|---|---|---|---|
| 安卓 11 | ? | ? | ? | ? | ? | ? |
| IOS 14 | ? | ? | ? | ? | ? | ? |
| 铬 90 大苏尔 | ? | ? | ? | ? | ? | ? |
| 边缘 90 大 sur | ? | ? | ? | ? | ? | ? |
| ff 88 大苏尔 | ? | ? | ? | ? | ? | ? |
| 野生动物园 … |
我找到了一种通过条形码连接 Wi-Fi 的方法。例如,我可以生成包含以下内容的条形码:
WIFI:T:WPA;S:mynetwork;P:mypass;;
Run Code Online (Sandbox Code Playgroud)
然后我就可以连接到它了。
但是是否也可以设置其他 Wi-Fi 设置,例如静态 IP或DNS 服务器?
即使卸载并重新安装后,我仍然面临 Visual Studio Code 标题栏中不支持的问题。有人可以帮我解决这个问题吗?
如何从 ISO 格式的日期中仅提取时间?我试过这个:
var d = new Date('1970-01-15T03:32:12.000Z'); //ISO-8601 formatted date returned from server
console.log(d.getTime());// 1222332000
Run Code Online (Sandbox Code Playgroud)
预期操作是:03:32:12
我有一个函数(尚未完成),该函数应检查用户名在Firebase数据库中是否已经存在/唯一。我在Google上搜索了如何实施此方法,并设法获得了以下信息。不幸的是,它不起作用,我什至没有任何console.logs。感谢您的帮助-我到底在做什么错?
onChangeUsername = (event) => {
var oldError = {...this.state.error};
firebase.database().ref().child("Usernames").orderByValue().once('value', (snapshot) => {
var exists = (snapshot.val() !== null);
console.log(exists);
console.log("hello");
});
if(this.state.validation.username.unique===true)
{oldError.username = "This username is already taken"}
else if((event.nativeEvent.text.length<this.state.validation.username.min) || (event.nativeEvent.text.length>this.state.validation.username.max) )
{oldError.username = "Username should be between " + this.state.validation.username.min + " and " + this.state.validation.username.max + " characters" ;}
else oldError.username = "";
this.setState({ username: event.nativeEvent.text, error:oldError })
}
Run Code Online (Sandbox Code Playgroud)
我的数据库结构如下:
Database:{ Usernames: {uid1: username1, uid2: username2}}
Run Code Online (Sandbox Code Playgroud)
****问题更新****在弗兰克发表评论后,我将代码更改为以下内容。它仍然不起作用,但是我发现了一些需要修复的错误:
onChangeUsername = (event) => {
var oldError …Run Code Online (Sandbox Code Playgroud) javascript ×3
css ×2
react-native ×2
android-wifi ×1
avahi ×1
bundle ×1
dns ×1
firebase ×1
firefox ×1
git ×1
git-bundle ×1
html ×1
ios ×1
iso ×1
nginx ×1
proxypass ×1
qr-code ×1
vagrant ×1
video ×1